-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verified non-issue with Sinon and Babel
Ref sinonjs/sinon#1711 It was said that the test failed. It did not, as suspected.
- Loading branch information
Showing
8 changed files
with
1,942 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["env"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function test() { | ||
return 'fail'; | ||
} | ||
|
||
exports.test = test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"use strict"; | ||
|
||
var _chai = require("chai"); | ||
|
||
var _chai2 = _interopRequireDefault(_chai); | ||
|
||
var _sinon = require("sinon"); | ||
|
||
var _sinon2 = _interopRequireDefault(_sinon); | ||
|
||
var _mod = require("./mod1"); | ||
|
||
var mod1 = _interopRequireWildcard(_mod); | ||
|
||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
var assert = _chai2.default.assert; // mod1Spec.js | ||
|
||
|
||
describe("test", function () { | ||
it("should correctly mock module method", function () { | ||
_sinon2.default.stub(mod1, "test").returns("pass"); | ||
assert.strictEqual(mod1.test(), "pass"); | ||
}); | ||
}); | ||
|
||
describe("the Module object", function () { | ||
it("should have a toStringTag symbol with the expected value", function () { | ||
assert.strictEqual(mod1[Symbol.toStringTag], "Module"); | ||
}); | ||
|
||
it("should use the toStringTag symbol", function () { | ||
var symbolString = mod1[Symbol.toStringTag]; | ||
assert.strictEqual(Object.prototype.toString.call(mod1), "[object " + symbolString + "]"); | ||
}); | ||
}); |
Oops, something went wrong.