Skip to content

Commit 503863b

Browse files
committedApr 26, 2018
Adding changes from #2559
1 parent c6ef219 commit 503863b

File tree

3 files changed

+67
-33
lines changed

3 files changed

+67
-33
lines changed
 

‎.circleci/config.yml

+61-31
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,67 @@
1-
# Javascript Node CircleCI 2.0 configuration file
2-
#
3-
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4-
#
51
version: 2
6-
jobs:
7-
build:
2+
3+
docker_defaults: &docker_defaults
84
docker:
9-
- image: circleci/node:8.4
5+
- image: circleci/node:8.11.1-browsers
6+
working_directory: ~/project/repo
107

11-
working_directory: ~/repo
8+
attach_workspace: &attach_workspace
9+
attach_workspace:
10+
at: ~/project
1211

12+
install_steps: &install_steps
1313
steps:
14-
- checkout
15-
16-
# Download and cache dependencies
17-
- restore_cache:
18-
keys:
19-
- v1-dependencies-{{ checksum "package.json" }}
20-
# fallback to using the latest cache if no exact match is found
21-
- v1-dependencies-
14+
- checkout
15+
- restore_cache:
16+
name: Restore node_modules cache
17+
keys:
18+
- dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
19+
- dependency-cache-{{ .Branch }}-
20+
- dependency-cache-
21+
- run:
22+
name: Installing Dependencies
23+
command: |
24+
yarn install --silent
25+
- save_cache:
26+
name: Save node_modules cache
27+
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
28+
paths:
29+
- node_modules/
30+
- persist_to_workspace:
31+
root: ~/project
32+
paths:
33+
- repo
2234

23-
- run: yarn install
24-
25-
- save_cache:
26-
paths:
27-
- node_modules
28-
key: v1-dependencies-{{ checksum "package.json" }}
29-
30-
# Start the examples server so that Cypress can run against them
31-
- run: yarn start
32-
# Install vxfb for Cypress
33-
- run: yarn add xvfb
34-
# Run eslint
35-
- run: yarn lint
36-
# Run tests
37-
- run: yarn test
35+
workflows:
36+
version: 2
37+
build_pipeline:
38+
jobs:
39+
- build
40+
- unit_test:
41+
requires:
42+
- build
43+
- end_to_end:
44+
requires:
45+
- build
46+
jobs:
47+
build:
48+
<<: *docker_defaults
49+
<<: *install_steps
50+
unit_test:
51+
<<: *docker_defaults
52+
steps:
53+
- *attach_workspace
54+
- run:
55+
name: Running unit tests
56+
command: |
57+
yarn lint
58+
yarn test:jest
59+
yarn coveralls
60+
end_to_end:
61+
<<: *docker_defaults
62+
steps:
63+
- *attach_workspace
64+
- run:
65+
name: Running E2E tests
66+
command: |
67+
yarn e2e

‎.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ indent_size = 2
1212

1313
[*.md]
1414
trim_trailing_whitespace = false
15+
16+
[.circleci/config.yml]
17+
indent_size = 4

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"chroma-js": "^1.3.6",
4141
"chrono-node": "^1.3.5",
4242
"codesandboxer": "^0.1.1",
43+
"concurrently": "^3.5.1",
4344
"copy-webpack-plugin": "^4.3.1",
4445
"coveralls": "^2.11.12",
4546
"cross-env": "^5.1.3",
@@ -93,14 +94,14 @@
9394
"scripts": {
9495
"build": "nps build && bundlesize",
9596
"watch": "nps build.watch",
96-
"cover": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha",
97-
"coveralls": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha && cat coverage/lcov.info | coveralls",
97+
"coveralls": "cat coverage/lcov.info | coveralls",
9898
"lint": "eslint .",
9999
"deploy": "cross-env NODE_ENV=production nps publish",
100100
"start": "webpack-dev-server --progress",
101101
"fresh": "rm -rf node_modules && yarn install",
102102
"test": "npm run test:jest && npm run test:cypress",
103103
"test:jest": "jest --coverage",
104+
"e2e": "concurrently --kill-others --success=first --names 'SERVER,E2E' 'yarn start' 'yarn test:cypress'",
104105
"test:cypress": "cypress run --spec ./cypress/integration/select_spec.js",
105106
"test:cypress-watch": "node ./node_modules/.bin/cypress open",
106107
"precommit": "flow check && lint-staged"

0 commit comments

Comments
 (0)