Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import test from 'ava';
import { jsdom } from 'jsdom';
import sinon from 'sinon';
import proxy from 'proxyquire';
import camelcase from 'camelcase';
const sandbox = sinon.sandbox.create();
const castStub = sandbox.stub().returnsArg(0);
const camelSpy = sandbox.spy(camelcase);
proxy.noCallThru();
const metaProps = proxy('../src', {
camelcase: camelSpy,
'./cast': castStub,
}).default;
proxy.callThru();
const doc = jsdom();
global.document = doc;
sandbox.spy(doc.head, 'querySelectorAll');
sandbox.stub(console, 'warn');
test.beforeEach(() => {
sandbox.reset();
doc.head.innerHTML = ''; // reset meta tags
});
test('no props returns empty object', (t) => {
t.deepEqual(metaProps(), {});
});
require("../setup");
const proxyquire = require("proxyquire").callThru();
const Promise = require("bluebird");
const util = require("util");
const _ = require("lodash");
/* global expect */
const env = {
name: "test",
baseUrl: "http://example.com",
_id: "VoKtrtXdqRS3VDAV",
image: "helloworld",
key: "key",
secret: "secret",
slackChannels: channelsList
};
require( "../setup" );
const proxyquire = require( "proxyquire" ).callThru();
const Promise = require( "bluebird" );
const util = require( "util" );
/* global */
const envId = "101";
const stackId = "202";
const stack = {
id: stackId,
type: "environment",
links: {
self: util.format( "/v1/projects/%s/environments/%s", envId, stackId ),
account: util.format( "/v1/projects/%s/environments/%s/account", envId, stackId ),
services: util.format( "/v1/projects/%s/environments/%s/services", envId, stackId ),
composeConfig: util.format( "/v1/projects/%s/environments/%s/composeconfig", envId, stackId )
},
actions: {
require( "../setup" );
const proxyquire = require( "proxyquire" ).callThru();
const baseURL = "http://myRancher.com";
const util = require( "util" );
const _ = require( "lodash" );
const envId = "l0l";
const environmentsBody = [ {
id: envId,
name: "Test",
state: "active", // not mentioned in docs
links: {
environments: `${baseURL }/v1/projects/${envId}/environments`,
containers: `${baseURL }/v1/projects/${envId}/containers`,
services: `${baseURL }/v1/projects/${envId}/services`,
stacks: `${baseURL }/v1/projects/${envId}/environments`
}
} ];
const stackId = "2a2";
require( "../setup" );
var proxyquire = require( "proxyquire" ).callThru();
var when = require( "when" );
var nock = require( "nock" );
var urlencode = require( "urlencode" );
var rp = require( "request-promise" );
var namesapce = "leankit";
var name = "cowpoke";
var tagToCheck = "tag1";
var validImage = namesapce + "/" + name + ":" + tagToCheck;
var invalidImage = namesapce + "/" + name + ":DNE";
var dockerhub = proxyquire( "../../src/dockerhub", {
"./util": {
getImageInfo: function( image ) {
if ( image === validImage ) {
return {
docker: {
repo: namesapce,