Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
grunt.shipit = shipit = new Shipit();
shipit.stage = 'test';
fetchFactory(grunt);
gruntLog.silent();
fetchFactory.__set__('mkdirp', mkdirpMock);
// Shipit config
shipit.initConfig({
test: {
workspace: '/tmp/workspace',
repositoryUrl: 'git://website.com/user/repo'
}
});
sinon.stub(grunt.shipit, 'local').yields();
});
beforeEach(function () {
grunt.shipit = shipit = new Shipit();
shipit.stage = 'test';
publishFactory(grunt);
gruntLog.silent();
// Shipit config
shipit.initConfig({
test: {
deployTo: '/remote/deploy'
}
});
shipit.releasePath = '/remote/deploy/releases/20141704123138';
shipit.releaseDirname = '20141704123138';
sinon.stub(shipit, 'remote').yields();
});
beforeEach(function () {
grunt.shipit = shipit = new Shipit();
shipit.stage = 'test';
updateFactory(grunt);
clock = sinon.useFakeTimers(1397730698075);
gruntLog.silent();
// Shipit config
shipit.initConfig({
test: {
workspace: '/tmp/workspace',
deployTo: '/remote/deploy'
}
});
sinon.stub(shipit, 'remote').yields();
sinon.stub(shipit, 'remoteCopy').yields();
});
beforeEach(function () {
grunt.shipit = shipit = new Shipit();
shipit.stage = 'test';
initFactory(grunt);
gruntLog.silent();
// Shipit config
shipit.initConfig({
test: {
workspace: '/tmp/workspace',
deployTo: '/remote/deploy'
}
});
});
runTask('deploy:clean', function (err) {
if (err) return done(err);
expect(shipit.remote).to.be.calledWith('(ls -rd /remote/deploy/releases/*|head -n 5;ls -d ' +
grunt.shipit.releasesPath + '/*)|sort|uniq -u|' +
'xargs rm -rf');
done();
});
});