Skip to content

Commit

Permalink
Test the library with undefined and production NODE_ENV.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydenseric committed Oct 27, 2018
1 parent d9545ac commit 98582b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Patch

- Remove redundant uses of `this` in the internal `GraphQLQuery` component constructor.
- Test the library with undefined and production `NODE_ENV`.

## 4.0.0

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@
"prepare:js": "babel src -d lib",
"prepare:jsdoc": "jsdoc-md",
"prepare:prettier": "prettier 'lib/**/*.{mjs,js}' readme.md --write",
"test": "npm run test:eslint && npm run test:prettier && npm run test:size && npm run test:mjs && npm run test:js",
"test": "npm run test:eslint && npm run test:prettier && npm run test:lib && NODE_ENV=production npm run test:lib",
"test:eslint": "eslint . --ext mjs,js",
"test:prettier": "prettier '**/*.{json,yml,md}' -l",
"test:size": "size-limit",
"test:mjs": "node --experimental-modules --no-warnings lib/test | tap-mocha-reporter spec",
"test:js": "node lib/test | tap-mocha-reporter spec",
"test:lib": "npm run test:lib:mjs && npm run test:lib:js",
"test:lib:mjs": "node --experimental-modules --no-warnings lib/test | tap-mocha-reporter spec",
"test:lib:js": "node lib/test | tap-mocha-reporter spec",
"prepublishOnly": "npm run prepare && npm test",
"watch": "watch 'npm run prepublishOnly --silent' src --interval 1"
},
Expand Down
7 changes: 7 additions & 0 deletions src/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ import reactDom from 'react-dom/server'
import t from 'tap'
import { GraphQL, Provider, Query, preload } from '.'

// eslint-disable-next-line no-console
console.log(
`Testing ${
process.execArgv.includes('--experimental-modules') ? 'ESM' : 'CJS'
} library with ${process.env.NODE_ENV} NODE_ENV…\n\n`
)

const EPOCH_QUERY = /* GraphQL */ `
{
epoch {
Expand Down

0 comments on commit 98582b2

Please sign in to comment.