1.0.2 • Published 5 years ago

global-test-harness v1.0.2

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

global-test-harness

NPM version NPM downloads Build status Coverage Status

Semantic Release Greenkeeper badge

Wallaby.js

Starts a jsdom instance and load global namespace code similar to module code for testing.

Usage

See src/index.spec.ts

Also, the file structure should match the namespace stucture, and each file should declares only one component. e.g. mycompany/product/SomeComponent.js declares MyCompany.product.SomeComponent.

If your code deviate from it, you can still use this library but you need to do this to get your component:

await harness.import('./relative/path/to/your/file')
const yourComponent = harness.get('YourCompany.yourProduct.yourComponent')

Note that this library does not resolve global namespace references magically. You need to load your files in the right order.

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

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago

0.6.12

6 years ago

0.6.11

6 years ago

0.6.10

6 years ago

0.6.9

6 years ago

0.7.9

6 years ago

0.6.8

6 years ago

0.6.7

6 years ago

0.6.6

6 years ago

0.6.5

6 years ago

0.6.4

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago