Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

chore: Cleanup test scripts #317

Merged
merged 3 commits into from
Sep 28, 2018
Merged

chore: Cleanup test scripts #317

merged 3 commits into from
Sep 28, 2018

Conversation

jmelberg-okta
Copy link
Contributor

Description

This PR unifies the package.json test script names for every package. This will provide developers to easily call one of the following:

# Run end-to-end tests
# Applies to Angular, React, Vue, and oidc-middleware
yarn test:e2e

# Run integration tests using WireShark
# Applies to jwt-verifier and oidc-middleware
yarn test:integration

# Run unit tests
# Applies to all packages
yarn test:unit

# Run entire test suite
# Applies to all packages
yarn test

This PR is broken into the following commits:

  • ab78894 - Adds eslint to yarn test for React package.
  • 4189e59 - Removed yarn pack and file install from test-harness in Angular package.
  • f202fef - Unify remaining package test scripts into format noted above.

Reviewers

@@ -8,19 +8,18 @@
"dist"
],
"scripts": {
"build:dependencies": "yarn ngc && cd test/e2e/harness && yarn install",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For context - we previously ran yarn pack to create a *.tgz of our @okta/okta-angular package, then would add it directly to our test-harness via yarn add (npm install --save).

This is unnecessary, as we can reference the package.json in the library via the relative install path (shown here).

@@ -27,7 +27,7 @@
"build:test": "rimraf e2e/dist && babel e2e/ -d e2e/dist",
"kill:port": "kill -9 $(lsof -t -i:8080 -sTCP:LISTEN) || true",
"pretest": "yarn kill:port && ./node_modules/.bin/webdriver-manager update --gecko false && yarn build:test",
"wait:server": "yarn start & ./node_modules/.bin/wait-on http://localhost:8080",
"wait:server": "BROWSER=none yarn start & ./node_modules/.bin/wait-on http://localhost:8080",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running end-to-end tests in React, we're now telling the dev server to not open the browser when it loads.

"build": "rimraf dist/ && cross-env NODE_ENV=production webpack --config webpack.config.js --output-library-target=umd -p",
"build:harness": "yarn --cwd test/e2e/harness install",
"build:package-info": "node ../../util/write-package-info.js . src/packageInfo.js",
"kill:port": "kill -9 $(lsof -t -i:8080 -sTCP:LISTEN) || true",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: We're closing the port (if open) before calling our tests. This means that there is a chance the dev server is still running once they finish.

Copy link
Contributor

@manueltanzi-okta manueltanzi-okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@jmelberg-okta jmelberg-okta merged commit dd849be into master Sep 28, 2018
@jmelberg-okta jmelberg-okta deleted the jm-cleanup-test-scripts branch September 28, 2018 20:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants