Skip to content

Commit

Permalink
fix: nodejs resolution and simplify namespaces (#15)
Browse files Browse the repository at this point in the history
* fix: nodejs resolution and simplify namespaces

Use latest domture and do global resolution here.

So I don't have to rely on systemjs's magic.

Also enable wallaby.

* chore: drop NodeJS 6

* chore: remove dead branch
  • Loading branch information
unional authored Jan 1, 2018
1 parent 2be5fc1 commit 31c6b2c
Show file tree
Hide file tree
Showing 15 changed files with 3,051 additions and 686 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
language: node_js

sudo: false
cache:
directories:
- ~/.npm
notifications:
email: false

node_js:
- "stable"
- '9'
- '8'
- '6'

branches:
only:
Expand All @@ -27,5 +26,5 @@ script:
after_script: greenkeeper-lockfile-upload

after_success:
- npm install coveralls && npm run coveralls
- npm install --no-save coveralls && npm run coveralls
- npm run semantic-release
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# global-test-harness

[![Greenkeeper badge](https://badges.greenkeeper.io/unional/global-test-harness.svg)](https://greenkeeper.io/)

[![stable][stable-image]][stable-url]
[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![Semantic Release][semantic-release-image]][semantic-release-url]
[![Greenkeeper badge][greenkeeper-image]][greenkeeper-url]
[![Wallaby.js][wallaby-image]][wallaby-url]

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

Expand All @@ -24,15 +25,8 @@ await harness.import('./relative/path/to/your/file')
const yourComponent = harness.get('YourCompany.yourProduct.yourComponent')
```

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

## Known issues

Some global script files are loaded as CommonJS files.
As a result the global variables are not propertly set.
It is caused by <https://github.com/systemjs/systemjs/issues/1744>
A workaround is to minify the file. That will help `systemjs` to detect it as a global script file.
Note that this library does not resolve global namespace references magically.
You need to load your files in the right order.

## Contribute

Expand Down Expand Up @@ -89,3 +83,9 @@ Generated by [`unional-cli@0.0.0`](https://github.com/unional/unional-cli)
[travis-url]: https://travis-ci.org/unional/global-test-harness
[coveralls-image]: https://coveralls.io/repos/github/unional/global-test-harness/badge.svg
[coveralls-url]: https://coveralls.io/github/unional/global-test-harness
[greenkeeper-image]: https://badges.greenkeeper.io/unional/global-test-harness.svg
[greenkeeper-url]: https://greenkeeper.io/
[semantic-release-image]:https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-release-url]:https://github.com/semantic-release/semantic-release
[wallaby-image]:https://img.shields.io/badge/wallaby.js-configured-green.svg
[wallaby-url]:https://wallabyjs.com
Loading

0 comments on commit 31c6b2c

Please sign in to comment.