diff --git a/.travis.yml b/.travis.yml index 0a073ee3..cb24e66a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,13 @@ cache: - $HOME/.npm - $HOME/.yarn-cache - node_modules + - ~/.cache node_js: - '8' - '10' +env: + - TEST_SUITE="test:unit" + - TEST_SUITE="test:e2e:ci" install: - yarn bootstrap script: diff --git a/package.json b/package.json index 7dd4b07e..29412935 100644 --- a/package.json +++ b/package.json @@ -8,24 +8,30 @@ "build:esm": "lerna run build:esm", "build-preview": "run-s build build-preview:lerna", "build-preview:lerna": "lerna run build-preview", + "build:demo": "run-s build build:demo:copy", + "build:demo:copy": "ncp packages/netlify-cms/dist dev-test/", "clean": "rimraf packages/*/dist dev-test/dist", "clean:lerna": "lerna clean --yes", "reset": "run-s clean clean:lerna", - "cache-ci": "node scripts/cache.js", - "test": "run-s clean lint jest e2e", - "test-ci": "run-s clean lint-quiet cache-ci jest e2e-ci", - "jest": "cross-env NODE_ENV=test jest --no-cache", - "e2e-prep": "run-s build e2e-move-build", - "e2e-move-build": "cp -r packages/netlify-cms/dist dev-test/", - "e2e-serve": "http-server dev-test", - "e2e-exec": "cypress run", - "e2e-exec-ci": "cypress run --record", - "e2e-exec-dev": "cypress open", - "e2e-run": "start-test e2e-serve 8080 e2e-exec", - "e2e-run-ci": "start-test e2e-serve 8080 e2e-exec-ci", - "e2e": "run-s e2e-prep e2e-run", - "e2e-ci": "run-s e2e-prep e2e-run-ci", - "e2e-dev": "start-test develop 8080 e2e-exec-dev", + "test": "run-s clean lint test:unit test:e2e", + "test-ci": "run-s clean lint-quiet test:unit test:e2e:ci", + "test:unit": "cross-env NODE_ENV=test jest --no-cache", + "test:e2e": "run-s build:demo test:e2e:run", + "test:e2e:ci": "run-s build:demo test:e2e:run-ci", + "test:e2e:dev": "start-test develop 8080 test:e2e:exec-dev", + "test:e2e:serve": "http-server dev-test", + "test:e2e:exec": "cypress run", + "test:e2e:exec-ci": "cypress run --record", + "test:e2e:exec-dev": "cypress open", + "test:e2e:run": "start-test test:e2e:serve 8080 test:e2e:exec", + "test:e2e:run-ci": "start-test test:e2e:serve 8080 test:e2e:exec-ci", + "lint": "run-p -c --aggregate-output lint:*", + "lint-quiet": "run-p -c --aggregate-output \"lint:* -- --quiet\"", + "lint:css": "stylelint --ignore-path .gitignore \"{packages/**/*.{css,js},website/**/*.css}\"", + "lint:js": "eslint --color --ignore-path .gitignore \"{{packages,scripts,website}/**/,}*.js\"", + "lint:format": "prettier \"{{packages,scripts,website}/**/,}*.{js,css}\" --list-different", + "format": "run-s \"lint:css -- --fix --quiet\" \"lint:js -- --fix --quiet\" \"format:prettier -- --write\"", + "format:prettier": "prettier \"{{packages,scripts,website}/**/,}*.{js,css}\"", "publish": "run-s publish:before-manual-version publish:after-manual-version", "publish:ci": "run-s publish:prepare \"publish:version --yes\" build publish:push-git \"publish:from-git --yes\"", "publish:before-manual-version": "run-s publish:prepare publish:version", @@ -45,15 +51,7 @@ "publish:graduate:ci": "run-s publish:prepare \"publish:version --conventional-graduate --yes\" build publish:push-git \"publish:from-git --yes\"", "publish:graduate:before-manual-version": "run-s publish:prepare publish:graduate:version", "publish:graduate:version": "run-s \"publish:version --conventional-graduate\"", - "publish:graduate:dry-run": "run-s \"publish:version --conventional-graduate --no-git-tag-version\"", - "format": "run-s \"lint:css -- --fix --quiet\" \"lint:js -- --fix --quiet\" \"format:prettier -- --write\"", - "format:prettier": "prettier \"{{packages,scripts,website}/**/,}*.{js,css}\"", - "lint": "run-p -c --aggregate-output lint:*", - "lint-quiet": "run-p -c --aggregate-output \"lint:* -- --quiet\"", - "lint:css": "stylelint --ignore-path .gitignore \"{packages/**/*.{css,js},website/**/*.css}\"", - "lint:js": "eslint --color --ignore-path .gitignore \"{{packages,scripts,website}/**/,}*.js\"", - "lint:format": "prettier \"{{packages,scripts,website}/**/,}*.{js,css}\" --list-different", - "add-contributor": "all-contributors add" + "publish:graduate:dry-run": "run-s \"publish:version --conventional-graduate --no-git-tag-version\"" }, "browserslist": [ "last 2 Chrome versions", @@ -100,6 +98,7 @@ "jest-cli": "^24.5.0", "jest-dom": "^3.1.3", "jest-emotion": "^10.0.9", + "ncp": "^2.0.0", "npm-run-all": "^4.1.5", "prettier": "1.16.4", "react-test-renderer": "^16.8.4", diff --git a/yarn.lock b/yarn.lock index 9e4f28be..221688db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8600,6 +8600,11 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= +ncp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" + integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= + needle@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d"