Skip to content

Commit eea9ea3

Browse files
committed
integration test foundations
1 parent 1d635e7 commit eea9ea3

File tree

6 files changed

+34
-23
lines changed

6 files changed

+34
-23
lines changed

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
language: node_js
22
sudo: false
3-
node_js: [6, 8, 10]
4-
after_success: "yarn coveralls"
3+
node_js: [8, 10]
4+
addons:
5+
chrome: stable
56
script:
67
- lerna bootstrap --ignore={demos}
7-
- yarn test
8+
- yarn test:unit
89
- lerna run test
10+
- yarn test:integration:build
11+
- yarn test:integration
12+
after_success: "yarn coveralls"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
- Removed unnecessary files from the packages
1313

14+
### Removed
15+
16+
- Removed test running from Node 6
17+
1418
## [3.0.0-alpha.2]
1519

1620
### Removed

browser-tests/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import React from "react";
22
import ReactDOM from "react-dom";
3+
// Using the following to support async/await in tests.
4+
// I'm intentionally not using babel/polyfill, as that would introduce polyfills
5+
// the actual lib might not have, giving the false impression that something
6+
// works while it might actually not, if you use the lib without babel-polyfill.
7+
import "babel-regenerator-runtime";
38

49
const Test = () => <div id="asd" style={{ background: "grey" }} />;
510

6-
// todo figure out how to make async-await work in parcel
7-
// todo make sure parcel transpiles down to IE10 (example: async and "Set" doesn't work properly)
8-
it("should render", () => {
11+
it("should render", async () => {
912
const div = document.createElement("div");
1013
document.body.appendChild(div);
1114

karma.conf.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
module.exports = function(config) {
2+
const singleRun = process.env.KARMA_SINGLE_RUN !== "false";
3+
4+
const ci = process.env.CI === "true";
5+
26
config.set({
37
basePath: ".",
48
frameworks: ["jasmine"],
59
files: ["browser-tests/dist/index.js"],
610
autoWatch: true,
711

8-
// todo come up with a way to switch in between dev / CI setup
9-
// browsers: ["Chrome"],
10-
// reporters: ["spec"],
12+
browsers: ci ? ["ChromeHeadless", "sl_chrome_70"] : ["Chrome"],
13+
reporters: ci ? ["spec", "saucelabs"] : ["spec"],
1114

12-
reporters: ["spec", "saucelabs"],
13-
browsers: ["sl_chrome_70"],
14-
15-
singleRun: true,
15+
singleRun,
1616

1717
// Max concurrency for SauceLabs OS plan
1818
concurrency: 5,
@@ -32,12 +32,6 @@ module.exports = function(config) {
3232
version: "70"
3333
}
3434
},
35-
36-
// Saucelabs launcher
37-
// sauceLabs: {
38-
// testName: 'react-container-query',
39-
// public: 'public'
40-
// },
4135
sauceLabs: {
4236
testName: "@zeecoder/container-query",
4337
public: "public"

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@babel/core": "^7.2.0",
1515
"babel-core": "^7.0.0-bridge.0",
1616
"babel-jest": "^23.6.0",
17+
"babel-regenerator-runtime": "^6.5.0",
1718
"coveralls": "^3.0.2",
1819
"husky": "^1.1.4",
1920
"jasmine-core": "^3.3.0",
@@ -33,10 +34,10 @@
3334
"regenerator-runtime": "^0.13.1"
3435
},
3536
"scripts": {
36-
"test": "jest --coverage",
37-
"test:watch": "jest --watch",
38-
"browser-test:build": "parcel build browser-tests/index.js --out-dir browser-tests/dist",
39-
"browser-test:run": "karma start",
37+
"test:unit": "jest --coverage",
38+
"test:unit:watch": "jest --watch",
39+
"test:integration": "karma start",
40+
"test:integration:build": "parcel build browser-tests/index.js --out-dir browser-tests/dist",
4041
"coveralls": "cat ./coverage/lcov.info | coveralls",
4142
"prettify": "prettier --write 'packages/**/*.js'",
4243
"bootstrap": "lerna bootstrap",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,11 @@ babel-preset-jest@^23.2.0:
16851685
babel-plugin-jest-hoist "^23.2.0"
16861686
babel-plugin-syntax-object-rest-spread "^6.13.0"
16871687

1688+
babel-regenerator-runtime@^6.5.0:
1689+
version "6.5.0"
1690+
resolved "https://registry.yarnpkg.com/babel-regenerator-runtime/-/babel-regenerator-runtime-6.5.0.tgz#0e41cd1c9f80442466f015c749fff8ba98f8e110"
1691+
integrity sha1-DkHNHJ+ARCRm8BXHSf/4upj44RA=
1692+
16881693
babel-register@^6.26.0:
16891694
version "6.26.0"
16901695
resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071"

0 commit comments

Comments
 (0)