Skip to content

Commit

Permalink
chore: upgrade sinon
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Ruf authored and Anton Drukh committed Oct 27, 2018
1 parent c98b8b3 commit 83d4fc1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/acceptance/cli.acceptance.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,7 @@ test('`test --insecure`', function (t) {
chdirWorkspaces('npm-package');

t.test('default (insecure false)', function (t) {
sinon.stub(needle, 'request', function (a, b, c, d, cb) {
sinon.stub(needle, 'request').callsFake(function(a, b, c, d, cb) {
cb(new Error('bail'));
});
t.teardown(needle.request.restore);
Expand All @@ -2000,7 +2000,7 @@ test('`test --insecure`', function (t) {
// by `args`, so we simply set the global here.
// NOTE: due to this we add tests to `args.test.js`
global.ignoreUnknownCA = true;
sinon.stub(needle, 'request', function (a, b, c, d, cb) {
sinon.stub(needle, 'request').callsFake(function (a, b, c, d, cb) {
cb(new Error('bail'));
});
t.teardown(function () {
Expand All @@ -2020,7 +2020,7 @@ test('`test --insecure`', function (t) {
* So, hijack the system exec call and return the expected output
*/
function stubExec(t, execOutputFile) {
var stub = sinon.stub(subProcess, 'execute', function () {
var stub = sinon.stub(subProcess, 'execute').callsFake(function () {
var stdout = fs.readFileSync(path.join(execOutputFile), 'utf8');
return Promise.resolve(stdout);
});
Expand Down
2 changes: 1 addition & 1 deletion test/prompts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function run(t, offset, filename) {
// because the answers passed back from the inquirer.prompt will next actually
// say if the user chose to patch
offset += 1;
spy.reset();
spy.resetHistory();
var vulns = require(filename);
return getPrompts(vulns).then(function (a) {
t.ok(!!a, 'prompts loaded');
Expand Down
2 changes: 1 addition & 1 deletion test/severity-threshold.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var cli = require('../src/cli/commands');

test('"snyk test --severity-threshold=high"', function(t) {

var requestStub = sinon.stub(needle, 'request', function (a, b, c, d, cb) {
var requestStub = sinon.stub(needle, 'request').callsFake(function (a, b, c, d, cb) {
cb(new Error('bail'));
});
t.teardown(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/wizard-prepare.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test('npm - prepare is added and postinstall is removed', function (t) {
test('yarn - prepare is added and postinstall is removed', function (t) {
var expectedResults = _.cloneDeep(fixture);
process.chdir(dir);
spy.reset();
spy.resetHistory();
return wizard.processAnswers({
// answers
'misc-test-no-monitor': true,
Expand Down

0 comments on commit 83d4fc1

Please sign in to comment.