mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #1807 from overleaf/as-global-sinon-chai
Globally load sinon-chai GitOrigin-RevId: b0175e021b98d6338171108c6778de80ee58479a
This commit is contained in:
parent
4e8facf3cc
commit
a3bcc71df9
7 changed files with 7 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
set -e;
|
||||
|
||||
MOCHA="node_modules/.bin/mocha --exit --recursive --reporter spec"
|
||||
MOCHA="node_modules/.bin/mocha --exit --recursive --reporter spec --require test/unit/bootstrap.js"
|
||||
|
||||
$MOCHA "$@" test/unit/js
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
set -e;
|
||||
|
||||
MOCHA="node_modules/.bin/mocha --exit --recursive --reporter spec"
|
||||
MOCHA="node_modules/.bin/mocha --exit --recursive --reporter spec --require test/unit/bootstrap.js"
|
||||
|
||||
$MOCHA "$@" test/unit/js
|
||||
|
|
5
services/web/test/unit/bootstrap.js
vendored
Normal file
5
services/web/test/unit/bootstrap.js
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
const chai = require('chai')
|
||||
|
||||
// Load sinon-chai assertions so expect(stubFn).to.have.been.calledWith('abc')
|
||||
// has a nicer failure messages
|
||||
chai.use(require('sinon-chai'))
|
|
@ -1,7 +1,5 @@
|
|||
sinon = require('sinon')
|
||||
chai = require('chai')
|
||||
sinonChai = require "sinon-chai"
|
||||
chai.use sinonChai
|
||||
should = chai.should()
|
||||
expect = chai.expect
|
||||
modulePath = "../../../../app/js/Features/Authentication/AuthenticationController.js"
|
||||
|
|
|
@ -4,9 +4,7 @@ SandboxedModule = require "sandboxed-module"
|
|||
assert = require "assert"
|
||||
chai = require "chai"
|
||||
sinon = require "sinon"
|
||||
sinonChai = require "sinon-chai"
|
||||
|
||||
chai.use sinonChai
|
||||
expect = chai.expect
|
||||
|
||||
modulePath = Path.join __dirname, "../../../../app/js/Features/Project/ProjectCollabratecDetailsHandler"
|
||||
|
|
|
@ -2,10 +2,8 @@ SandboxedModule = require('sandboxed-module')
|
|||
assert = require('assert')
|
||||
chai = require('chai')
|
||||
sinon = require('sinon')
|
||||
sinonChai = require('sinon-chai')
|
||||
|
||||
chai.should()
|
||||
chai.use(sinonChai)
|
||||
expect = chai.expect
|
||||
|
||||
modulePath = '../../../../app/js/Features/Templates/TemplatesController'
|
||||
|
|
|
@ -2,10 +2,8 @@ SandboxedModule = require('sandboxed-module')
|
|||
assert = require('assert')
|
||||
chai = require('chai')
|
||||
sinon = require('sinon')
|
||||
sinonChai = require('sinon-chai')
|
||||
|
||||
should = require('chai').should()
|
||||
chai.use(sinonChai)
|
||||
|
||||
modulePath = '../../../../app/js/Features/Templates/TemplatesManager'
|
||||
|
||||
|
|
Loading…
Reference in a new issue