forked from mroderick/sinon-issue-1711
-
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.
- Loading branch information
Showing
1 changed file
with
22 additions
and
8 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 |
---|---|---|
@@ -1,14 +1,28 @@ | ||
// mod1Spec.js | ||
import chai from 'chai'; | ||
import sinon from 'sinon'; | ||
import chai from "chai"; | ||
import sinon from "sinon"; | ||
|
||
import * as mod1 from './mod1'; | ||
import * as mod1 from "./mod1"; | ||
|
||
const assert = chai.assert; | ||
|
||
describe('test', function () { | ||
it('should correctly mock module method', () => { | ||
sinon.stub(mod1, 'test').returns('pass'); | ||
assert.strictEqual(mod1.test(), 'pass'); | ||
describe("test", function() { | ||
it("should correctly mock module method", () => { | ||
sinon.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", () => { | ||
assert.strictEqual(mod1[Symbol.toStringTag], "Module"); | ||
}); | ||
|
||
it("should use the toStringTag symbol", () => { | ||
const symbolString = mod1[Symbol.toStringTag]; | ||
assert.strictEqual( | ||
Object.prototype.toString.call(mod1), | ||
`[object ${symbolString}]` | ||
); | ||
}); | ||
}); |