- Remove
chaid
which was an unsafe ID assertion library with no types
- Ported to Typescript
Remove exported runtest
"binary".
To replace its usage with an equivalent inlined command, add a dependency on nyc
:
yarn add --dev nyc
add a _mocha
script that runs
NODE_ENV=test yarn run nyc --report-dir=.coverage --temp-directory=.coverage/.nyc_output --reporter=lcov --reporter=text-summary mocha --require=@babel/register --exit
(This assumes you're using Babel 7; otherwise change @babel/register
to babel-register
.)
and replace uses of runtest
with yarn run _mocha
.
Finally, to continue conforming to best
practices,
include a runtest
package script that runs:
yarn run _mocha
See here for an example.
- Fix deploy from travis
- Build for browser as well as node
- Load dependencies from public node registry
- Run tests in CI
- Build for Node 8
- Deploy from Travis
- Format with Prettier
- Fix flow typedefs
- Add
createRollbarStub
,createAnalyticsStub
, andcreateLoggerStub
; the first two are mocks we commonly copy/paste between repositories; the latter is a factory we usually get fromuseSinonSandbox
, but in a mutative stub pattern. This adapts each stub to use our more common factory pattern. - Remove first args to
before/after/beforeEach/afterEach
to fix Jest compatibility - Bump node to 8.11.4 on Travis
- Update development scripts to be more standard
- Fix Flow v0.75.0 incompatibility
- Add
.blank()
assertion to Chai type definition
- Add Enzyme
className
,props
type definitions
- Fix Sinon
callsFake
type definition
useSinonSandbox()
returns a{sandbox, stubLogger}
this.stub
=>sandbox.stub
this.spy
=>sandbox.spy
const clock = sandbox.useFakeTimers()
to mock timethis.stubTime()
=>clock.setSystemTime()
this.stubLogger()
=>stubLogger()
sinon.match()
=>sandbox.match()
- sinon no longer exported. Use
sandbox
from{useSinonSandbox}
instead
- Fix flowtype definitions
- Add missing chai, chai-enzyme assertions to flowtype
- Fix path to Sinon in browser environments
this.stubLogger({logger})
=>this.stubLogger(logger)
- Remove support for
babel-node
ing a test file - No more import side-effects. Always run tests via npm script. Simplifies interface and enforces single standard for running tests. - Export all helpers from
index.js
- No more reaching into the module (e.g.goodeggs-test-helpers/chai
) - Move
./run_tests.sh
fromgoodeggs-ops-api-test-helpers
(previously calledapi_test.sh
) - so we can use it for modules too - Remove
withContext()
- prefer mocha'sbeforeEach
instead - Remove
given()
- prefer mocha'sdescribe
orcontext
instead - Explicitly define sinon sandboxes via
useSinonSandbox()
- No more import side effects. See which hooks are configured at the top of each test file. This also means that the clock is no longer stubbed be default. - Move
stubLogger
fromgoodeggs-ops-api-test-helpers
- so all sinon sandboxing is centralized and so we can deletegoodeggs-ops-api-test-helpers
- Remove
chai-json-schema
- almost never used! - Bump to latest version of all dependencies (including
chai
andmocha
) - Remove
this.assert
andthis.expect
- import explicitly fromgoodeggs-test-helpers
instead
- bumps from version
1.14.1
to4.1.6
of Sinon. We now have access tostub.callsFake
to change the implementation of a stub on the fly.
Sinon APIs for:
sinon.stub
sinon.useFakeTimers
sinon.sandbox
stub.reset
have changed subtly (but for the better). Look at the Sinon.js changelog (2.0, 3.0, and 4.0) for details.