Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support running tests in the browser, Node, or both #30

Merged
merged 1 commit into from
Oct 19, 2017
Merged

Conversation

tomdale
Copy link
Contributor

@tomdale tomdale commented Oct 18, 2017

Currently, the monorepo only supports building and running tests for the browser. However, we're on the verge of introducing some new build tools that only run in Node.js environments. We also need to get more of the packages running in Node to support SSR use cases.

The recent refactor to build tests with Rollup makes testing in Node a relatively incremental step. In this PR, the tests are compiled and run against the CommonJS build of the packages.

To facilitate easily writing packages that work in both environments, there is a convention for organizing tests according to the environment they should be run in:

  1. test/node/**/*-test.ts run only in Node.
  2. test/browser/**/*-test.ts run only in the browser.
  3. test/**/*-test.ts runs in both environments.

To start off I moved most tests into the browser directory because they fail in Node, but many of these are due to accidental coupling to the DOM and we can migrate them piecemeal to run in both as we work on the public SSR API.

@tomdale tomdale merged commit c2083cf into master Oct 19, 2017
@tomdale tomdale deleted the node-tests branch October 19, 2017 15:57
topaxi pushed a commit to topaxi/glimmer.js that referenced this pull request Oct 27, 2017
Point ember-cli dependency to Canary channel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant