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

e2e tests for examples #516

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
5ff6a22
create initial e2e test examples module
macintoshhelper May 10, 2020
d1218ec
export app components from examples for pure test imports
macintoshhelper May 10, 2020
8d95bee
migrate emotion example to use @emotion/primitives + @emotion/core
macintoshhelper May 10, 2020
2c11811
remove flow types from form validation TextBox component
macintoshhelper May 10, 2020
78c3170
fix svg export for es2015 #515
macintoshhelper May 10, 2020
863a2ed
add test:e2e:examples script to root package.json
macintoshhelper May 10, 2020
9c0ce94
add e2e examples comment [ci skip]
macintoshhelper May 10, 2020
91cd02c
undo import Svg fix attempt
macintoshhelper May 10, 2020
5100750
Merge branch 'master' into dev/e2e-example-tests
macintoshhelper May 10, 2020
bd95ed3
downgrade @skpm/test-runner to fix e2e tests
macintoshhelper May 25, 2020
3850931
use import alias to work with e2e tests
macintoshhelper May 25, 2020
fd830e3
add babel/webpack setup for e2e example tests
macintoshhelper May 25, 2020
1981ae8
add e2e examples test
macintoshhelper May 25, 2020
746b8e7
Merge branch 'dev/e2e-example-tests' of github.com:macintoshhelper/re…
macintoshhelper May 25, 2020
31a6478
fix e2e examples webpack module alias
macintoshhelper May 25, 2020
29779eb
migrate skpm webpack.config to __tests__/examples
macintoshhelper May 25, 2020
38bb39c
add prepublishOnly script for installing/building e2e examples depend…
macintoshhelper May 25, 2020
2bcf86c
re-use aggregate example App code/imports for e2e example
macintoshhelper May 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add prepublishOnly script for installing/building e2e examples depend…
…encies
macintoshhelper committed May 25, 2020
commit 38bb39ca34a4ab06066c324c62b49991b914f1e7
3 changes: 3 additions & 0 deletions __tests__/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Aggregate of All Examples

This is used for `__tests__/skpm/examples.test.js` (dependencies), and can be used to test that `skpm-build` works for all examples.
12 changes: 2 additions & 10 deletions __tests__/skpm/package.json
Original file line number Diff line number Diff line change
@@ -9,15 +9,7 @@
}
},
"scripts": {
"test:e2e": "../../node_modules/.bin/skpm-test"
"test": "../../node_modules/.bin/skpm-test"
},
"license": "MIT",
"dependencies": {
"@emotion/core": "^10.0.28",
"@emotion/primitives": "^10.0.30",
"chroma-js": "^1.2.2",
"emotion-primitives": "^1.0.0-beta.0",
"ramda": "^0.27.0",
"react-primitives": "^0.8.1"
}
"license": "MIT"
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -30,14 +30,15 @@
"docs:watch": "npm run docs:prepare && gitbook serve",
"docs:publish": "npm run docs:clean && npm run docs:build && cd _book && git init && git commit --allow-empty -m 'update book' && git fetch https://github.com/airbnb/react-sketchapp gh-pages && git checkout -b gh-pages && git add . && git commit -am 'update book' && git push https://github.com/airbnb/react-sketchapp gh-pages --force",
"lint-staged": "lint-staged",
"prepublishOnly": "npm run clean && npm run test:ci && npm run build",
"prepublishOnly": "npm run clean && npm run test:ci && npm run install:e2e && npm run build",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

npm run install:e2e triggers the __tests__/examples postinstall script. Not sure if this should be left in, it'll fail the prepublish script if the examples skpm-build fails, but not sure if it'll work in CI.

"prettier:base": "prettier --write",
"prettify": "npm run prettier:base \"src/**/*.(j|t)sx?\" \"examples/**/*.(j|t)sx?\" \"__tests__/**/*.(j|t)sx?\" \"docs/**/*.md\"",
"install:e2e": "npm install --prefix __tests__/examples",
"test": "npm run test:unit && npm run test:e2e",
"test:unit": "jest --config jest.config.js --no-watchman",
"test:ci": "npm run test:unit -- --runInBand",
"test:e2e": "npm run test:e2e --prefix __tests__/skpm",
"test:e2e:examples": "npm run build --prefix __tests__/examples/",
"test:e2e": "npm run test --prefix __tests__/skpm",
"test:e2e:build": "npm run build --prefix __tests__/examples/",
"test:update": "npm run test -- --updateSnapshot",
"test:e2e:watch": "npm run test:e2e -- --watch",
"watch": "run-s clean build:main && run-p \"build:main -- -w\" \"test:unit -- --watch\""