Testing helper for @cfware/tap-selenium-manager with fastify
import t from 'libtap';
import {testBrowser} from '@cfware/tap-selenium-manager';
import {FastifyTestHelper} from '@cfware/fastify-test-helper';
testBrowser(t, 'firefox', new FastifyTestHelper(), {
async 'index.html'(t, selenium) {
// Test index.html here
}
});See tests in @cfware/history-state for a real life usage example.
options- optional settings specific to setup of the fastify daemon.
Sets the current working directory, default process.cwd().
The base path to serve node_modules. Default /node_modules.
Sets the local directory to serve under options.nodeModulesPrefix.
Default to node_modules under options.cwd.
The base path which contains pages to be tested. Default /.
Points to files which should be served under options.testsPrefix.
Default to fixtures under options.cwd.
This object is used to register custom GET URL's to a local path.
Example:
{
customGetters: {
'/url.js': 'index.js'
}
}This will cause requests to the URL /url.js to serve index.js. The
path of index.js is relative to process.cwd(), no attempt is made to
prevent serving parent directories.
Ignores any .babelrc and babel.config.js settings by default.
The following plugins are enabled by default:
- babel-plugin-remove-ungap
- babel-plugin-bare-import-rewrite
- babel-plugin-istanbul
- @babel/plugin-proposal-optional-chaining (loose mode)
The following parser plugins are enabled by default:
- objectRestSpread
- importMeta
- classProperties
If options.babelrc is provided it replaces the default settings. Default
options can be retrieved from the defaultBabelRC named export and merged
using Object.assign or ES2018 object spread.