Implicit "global" options merging is no longer supported
In previous versions of babel-plugin-tester, any test object and fixture configuration option could be passed directly to babel-plugin-tester and apply "globally" across all test objects and fixtures. This was even the case for options that made no sense in a "global" context, such as only, skip, and code. In this version of babel-plugin-tester, only options explicitly listed in the documentation can be passed directly and applied globally. Unrecognized "rest" options are silently ignored.
Test/fixture configuration is resolved early and consistently
In previous versions of babel-plugin-tester, test object and fixture configuration options were resolved in various places, with some options getting finalized before it(...) and describe(...) were called and others being determined as Jest was executing the test. In this version, all configuration options are resolved and finalized before it(...) and describe(...) are called. This also means configurations are finalized before hooks like beforeAll get called by the testing framework.
Fixture configuration schema is standardized
In previous versions of babel-plugin-tester, you could provide any key to options.json and it would be passed as-is to the plugin under test. This made it impossible to allow fixtures to be configured with the same flexibility as test objects. In this version of babel-plugin-tester, fixture options.json (and options.js) files must return a standard set of options. Non-standard properties are silently ignored. For instance: to pass options to the plugin under test, they must be provided via pluginOptions.
Global setup/teardown no longer overwrites local versions
In previous versions of babel-plugin-tester, test-level setup and teardown functions overrode global setup and teardown functions. In this version of babel-plugin-tester, the global setup and teardown functions will be called alongside their test-level counterparts for each test and in a well-defined order (see documentation).
TypeError for config error; AssertionError for test error
All configuration-related issues now throw TypeError instead of AssertionError. AssertionError is now exclusively used for failing tests. Additionally, the text of some error messages has been updated.
error only captures exceptions from Babel
error (aka throws) no longer potentially captures exceptions thrown by the formatResult function. If the formatResult function throws, the entire test will fail immediately.
error no longer accepts arbitrary class constructors
error (aka throws) no longer accepts arbitrary class constructors. Any provided class constructor must extend Error, e.g. built-ins like SyntaxError or custom error classes like class MyError extends Error. Thanks to the nature of JavaScript, providing a class constructor that does not extend Error will lead to undefined behavior.
Built-in TypeScript support
TypeScript types are now included within the package itself, obviating the need to install a separate types package. Installing the old types package alongside this version of babel-plugin-tester will cause conflicts.
Global describe and it functions must be defined
babel-plugin-tester will refuse to run if describe or it are not globally available.
src: ensure deprecated config option is still supported by prettierFormatter ([e48badf][4]) closes #139[5]
[11.0.0][6] (2023-01-18)
💥 Breaking Changes 💥
error no longer accepts arbitrary class constructors
error (aka throws) no longer accepts arbitrary class constructors. Any
provided class constructor must extend Error, e.g. built-ins like
SyntaxError or custom error classes like class MyError extends Error. Thanks
to the nature of JavaScript, providing a class constructor that does not
extend Error will lead to undefined behavior.
error only captures exceptions from Babel
error (aka throws) no longer potentially captures exceptions thrown by the
formatResult function. If the formatResult function throws, the entire test
will fail immediately.
TypeError for config error; AssertionError for test error
All configuration-related issues now throw TypeError instead of
AssertionError. AssertionError is now exclusively used for failing tests.
Additionally, the text of some error messages has been updated.
All test titles are now numbered
All test titles are now numbered (e.g. "1. ...", "2. ...", etc), including
fixtures tests and tests with custom titles.
Built-in TypeScript support
TypeScript types are now included within the package itself, obviating the need
to install a separate types package. Installing the old types package alongside
this version of babel-plugin-tester will cause conflicts.
Fixture configuration schema is standardized
In previous versions of babel-plugin-tester, you could provide any key to
options.json and it would be passed as-is to the plugin under test. This made
it impossible to allow fixtures to be configured with the same flexibility as
test objects. In this version of babel-plugin-tester, fixture options.json
(and options.js) files must return a standard set of options. Non-standard
properties are silently ignored. For instance: to pass options to the plugin
under test, they must be provided via pluginOptions.
This version was pushed to npm by xunnamius, a new releaser for babel-plugin-tester since your current version.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps babel-plugin-tester from 10.1.0 to 11.0.1.
Release notes
Sourced from babel-plugin-tester's releases.
... (truncated)
Changelog
Sourced from babel-plugin-tester's changelog.
... (truncated)
Commits
66ffb3f
release: 11.0.1 [skip ci]e48badf
fix(src): ensure deprecatedconfig
option is still supported by `prettierFo...b6b05c9
docs: add layershifter and others to all-contributors8a25595
release: 11.0.0 [skip ci]427fced
docs: update documentationbfd3f3c
chore(package): update dependenciesc13a2e0
docs(readme): add other examples365b025
docs(readme): ensure examples work using standard prettier configurationf780ddf
test(integration): ensure node:tests "not ok" are detected30d37f3
refactor(src): fix typoMaintainer changes
This version was pushed to npm by xunnamius, a new releaser for babel-plugin-tester since your current version.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)