全新的测试。试图弄清楚为什么 mocha 在它应该失败的时候通过了这个测试。
var assert = require('assert');
var nock = require('nock');
var https = require('https');
describe('thing', function() {
describe('foo', function () {
it('makes the correct https call to API', function () {
nock('https://example.com')
.get('/foo')
.reply(404);
https.get('https://example.com/foo', function (response) {
console.log(response.statusCode); // returns 404
assert.equal(response.statusCode, 200); //passes
});
});
});
});