domture
domture
allows you to load packages and scripts directly on a jsdom
instance for testing purpose.
You can load npm
packages as well as local files (by default relative to current working directory .
).
domture
supports two loaders: systemjs
and webpack
.
When using systemjs
, it leveages systemjs
magic to load any type of module files.
However, certain NodeJS resolution does not work currently, and also code coverage is not available.
When using webpack
, it bundles the files you try to import with webpack
and load them into jsdom
through script tags.
The NodeJS resolution is complete and code coverage is (will be) available.
However, additional bundle time is needed and bundles management still need to be planned out and implemented in the future.
You also lost the magic from systemjs
.
By default, webpack
will be used as the default loader.
For projects using webpack@4
, please use domture@2
. For webpack@3
, please use domture@1
Usage
test'basic usage', test'customize', test'customize with webpack', test'customize with systemjs',
Contribute
# right after clone npm install # begin making changes git checkout -b <branch>npm run watch # edit `webpack.config.es5.js` and `rollup.config.es2015.js` to exclude dependencies for the bundle if needed # after making change(s) git commit -m "<commit message>"git push # create PR
Npm Commands
There are a few useful commands you can use during development.
# Run tests (and lint) automatically whenever you save a file. npm run watch # Run tests with coverage stats (but won't fail you if coverage does not meet criteria) npm run test # Manually verify the project. # This will be ran during 'npm preversion' so you normally don't need to run this yourself. npm run verify # Build the project. # You normally don't need to do this. npm run build # Run tslint # You normally don't need to do this as `npm run watch` and `npm version` will automatically run lint for you. npm run lint
Generated by unional-cli@0.0.0