Created
January 17, 2020 10:29
-
-
Save moriya-hm5/193af67c38115b4e749229c5aa1b7d49 to your computer and use it in GitHub Desktop.
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
const chai = require('chai') | |
const sinon = require('sinon') | |
const sandbox = sinon.createSandbox() | |
const expect = chai.expect | |
describe('sinon', function () { | |
it('sinonのテスト', function(){ | |
sandbox.stub(process.env, 'PATH').value('12345') | |
expect(process.env.PATH).to.equal('12345') // passになる | |
}) | |
afterEach(function () { | |
sandbox.restore() | |
}); | |
after(function () { | |
sinon.restore() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment