Skip to content

Commit

Permalink
fix: Review Fixes
Browse files Browse the repository at this point in the history
* remove invalid watch spec for rollup files
* remove specialized watch commands since watch covers everything now
* added a script to ensure server, app and tests are built before running testem
  • Loading branch information
Aaron Graves committed Aug 5, 2019
1 parent f82c1c1 commit 795cd4c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -39,14 +39,15 @@
"scripts": {
"build": "lerna run build --ignore=@pollyjs/ember --parallel",
"build:prod": "NODE_ENV=production yarn build && NODE_ENV=production MINIFY=true yarn build",
"build:watch": "npm-run-all clean watch",
"prewatch": "yarn clean server:build",
"prewatch": "yarn server:build",
"watch": "lerna run watch-all --parallel",
"test:check": "./scripts/require-test-build.sh",
"clean": "rimraf packages/@pollyjs/*/dist",
"lint": "eslint .",
"lint:fix": "yarn run lint --fix",
"postlint:fix": "prettier --ignore-path .eslintignore --write \"**/*.{json,md,html,yml,css}\"",
"pretest:ci": "npm-run-all clean server:build build",
"pretest:ci": "npm-run-all clean test:clean server:build build",
"pretest": "yarn test:check",
"test": "testem",
"test:ci": "testem ci",
"test:build": "lerna run test:build --parallel",
Expand All @@ -55,7 +56,6 @@
"test:jest": "jest",
"test:ember": "lerna run test --stream --no-prefix --scope=@pollyjs/ember",
"server:build": "yarn build --scope=@pollyjs/node-server --scope=@pollyjs/utils",
"server:watch": "yarn build:watch --scope=@pollyjs/node-server --scope=@pollyjs/utils",
"docs:serve": "docsify serve ./docs",
"docs:publish": "gh-pages --dist docs --dotfiles --message 'chore: Publish docs'",
"release": "npm-run-all \"release:version {@}\" release:publish --",
Expand Down
16 changes: 16 additions & 0 deletions scripts/require-test-build.sh
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

if [ ! -f "./packages/@pollyjs/node-server/dist/cjs/pollyjs-node-server.js" ]; then
echo "pollyjs: test server build not found; run either '$ yarn watch' or '$ yarn server:build'"
exit 1
fi

if [ ! -f "./packages/@pollyjs/core/dist/cjs/pollyjs-core.js" ]; then
echo "pollyjs: build not found; run either '$ yarn watch' or '$ yarn build'"
exit 1
fi

if [ ! -f "./packages/@pollyjs/core/build/node/test-bundle.cjs.js" ]; then
echo "pollyjs: test build not found; run either '$ yarn watch' or '$ yarn test:build'"
exit 1
fi
2 changes: 1 addition & 1 deletion testem.js
Expand Up @@ -8,7 +8,7 @@ module.exports = {
launch_in_ci: ['Chrome', 'Node', 'Jest', 'Ember', 'ESLint'],
launch_in_dev: ['Chrome', 'Node', 'Jest', 'Ember', 'ESLint'],
watch_files: [
'./scripts/rollup/**/*',
'./scripts/rollup/*',
'./packages/@pollyjs/*/build/**/*',
'./packages/@pollyjs/*/dist/**/*'
],
Expand Down

0 comments on commit 795cd4c

Please sign in to comment.