BREAKING CHANGES
- Remove
chaid
which was an unsafe ID assertion library with no types
Other
BREAKING CHANGES
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.
Bug fixes
Bug fixes
- Build for browser as well as node
Bug fixes
- Load dependencies from public node registry
- Run tests in CI
Other
- Build for Node 8
- Deploy from Travis
- Format with Prettier
- Add
createRollbarStub
, createAnalyticsStub
, and createLoggerStub
; the first two are mocks we commonly copy/paste between repositories; the latter is a factory we usually get from useSinonSandbox
, 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
BREAKING CHANGES
useSinonSandbox()
returns a {sandbox, stubLogger}
this.stub
=> sandbox.stub
this.spy
=> sandbox.spy
const clock = sandbox.useFakeTimers()
to mock time
this.stubTime()
=> clock.setSystemTime()
this.stubLogger()
=> stubLogger()
sinon.match()
=> sandbox.match()
- sinon no longer exported. Use
sandbox
from {useSinonSandbox}
instead
- Add missing chai, chai-enzyme assertions to flowtype
- Fix path to Sinon in browser environments
BREAKING CHANGES
this.stubLogger({logger})
=> this.stubLogger(logger)
BREAKING CHANGES
- 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
from goodeggs-ops-api-test-helpers
(previously called api_test.sh
) - so we can use it for modules too
- Remove
withContext()
- prefer mocha's beforeEach
instead
- Remove
given()
- prefer mocha's describe
or context
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
from goodeggs-ops-api-test-helpers
- so all sinon sandboxing is centralized and so we can delete goodeggs-ops-api-test-helpers
- Remove
chai-json-schema
- almost never used!
- Bump to latest version of all dependencies (including
chai
and mocha
)
- Remove
this.assert
and this.expect
- import explicitly from goodeggs-test-helpers
instead
- bumps from version
1.14.1
to 4.1.6
of Sinon. We now have access to stub.callsFake
to change the implementation of a stub on the fly.
BREAKING CHANGES
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.