diff --git a/mod1spec.js b/mod1spec.js index dd53c10..2433bcf 100644 --- a/mod1spec.js +++ b/mod1spec.js @@ -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"); }); -}); \ No newline at end of file +}); + +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}]` + ); + }); +});