Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit 1fecb5b

Browse files
authored
chore: add e2e test, refactor/lint, upgrade deps (#62)
add e2e test adds e2e test that snapshots cypress stdout refactor/ lint rename tests/snapshots lint files add yarn.lock upgrade deps upgrade eslint and use new eslint deps
1 parent 175abcf commit 1fecb5b

23 files changed

+10379
-55
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test/_test-output
2+
cypress/tests/e2e/compile-error.js
3+
test/fixtures

.eslintrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.eslintrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"plugins": [
3+
"@cypress/dev"
4+
],
5+
"extends": [
6+
"plugin:@cypress/dev/general"
7+
],
8+
"env": {
9+
"node": true
10+
}
11+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ node_modules/
22
.DS_Store
33
*.log*
44
_test-output
5+
cypress/videos
6+
cypress/screenshots

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.9.3
1+
8.12.0
File renamed without changes.

__snapshots__/e2e.spec.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
exports['can test test: cypress/tests/e2e/compile-error.js 1'] = `
2+
3+
====================================================================================================
4+
5+
(Run Starting)
6+
7+
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
8+
│ Cypress: 1.2.3 │
9+
│ Browser: FooBrowser 88 │
10+
│ Specs: 1 found (e2e/compile-error.js) │
11+
│ Searched: cypress/tests/e2e/compile-error.js │
12+
└────────────────────────────────────────────────────────────────────────────────────────────────┘
13+
14+
15+
────────────────────────────────────────────────────────────────────────────────────────────────────
16+
17+
Running: e2e/compile-error.js (1 of 1)
18+
19+
Oops...we found an error preparing this test file:
20+
21+
cypress/tests/e2e/compile-error.js
22+
23+
The error was:
24+
25+
./cypress/tests/e2e/compile-error.js
26+
Module build failed (from ./node_modules/babel-loader/lib/index.js):
27+
SyntaxError: /[cwd]/cypress/tests/e2e/compile-error.js: Unexpected token, expected "," (12:27)
28+
29+
10 |
30+
11 | describe('foo', ()=>{
31+
> 12 | it('has syntax error' () => {}})
32+
| ^
33+
13 | })
34+
14 |
35+
36+
@ multi ./cypress/tests/e2e/compile-error.js main[0]
37+
38+
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
39+
40+
- A missing file or dependency
41+
- A syntax error in the file or one of its dependencies
42+
43+
Fix the error in your code and re-run your tests.
44+
45+
(Results)
46+
47+
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
48+
│ Tests: 0 │
49+
│ Passing: 0 │
50+
│ Failing: 1 │
51+
│ Pending: 0 │
52+
│ Skipped: 0 │
53+
│ Screenshots: 0 │
54+
│ Video: true │
55+
│ Duration: X seconds │
56+
│ Spec Ran: e2e/compile-error.js │
57+
└────────────────────────────────────────────────────────────────────────────────────────────────┘
58+
59+
60+
(Video)
61+
62+
- Started processing: Compressing to 32 CRF
63+
- Finished processing: /[cwd]/cypress/videos/e2e/compile-error.js.mp4 (X second)
64+
65+
66+
====================================================================================================
67+
68+
(Run Finished)
69+
70+
71+
Spec Tests Passing Failing Pending Skipped
72+
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
73+
│ ✖ e2e/compile-error.js XX:XX - - 1 - - │
74+
└────────────────────────────────────────────────────────────────────────────────────────────────┘
75+
✖ 1 of 1 failed (100%) XX:XX - - 1 - -
76+
77+
78+
`

circle.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,27 @@ workflows:
99
jobs:
1010
test:
1111
docker:
12-
- image: circleci/node:8
12+
- image: cypress/base:8
1313

1414
steps:
1515
- checkout
16-
16+
17+
- restore_cache:
18+
keys:
19+
- cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
1720
- run:
18-
name: Install dependencies
19-
command: npm install
20-
21+
name: Yarn install
22+
command: yarn install --frozen-lockfile
23+
- save_cache:
24+
key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
25+
paths:
26+
- ~/.cache
2127
- run:
2228
name: Lint code
2329
command: npm run lint
24-
30+
- run:
31+
name: Cypress Verfiy
32+
command: $(npm bin)/cypress verify
2533
- run:
2634
name: Run tests
2735
command: npm test

cypress.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"integrationFolder": "cypress/tests"
3+
}

cypress/plugins/index.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************************
3+
// This example plugins/index.js can be used to load plugins
4+
//
5+
// You can change the location of this file or turn off loading
6+
// the plugins file with the 'pluginsFile' configuration option.
7+
//
8+
// You can read more here:
9+
// https://on.cypress.io/plugins-guide
10+
// ***********************************************************
11+
12+
// This function is called when a project is opened or re-opened (e.g. due to
13+
// the project's config changing)
14+
15+
const webpack = require('../../')
16+
17+
// const webpackOptions = require('@packages/runner/webpack.config.ts').default
18+
19+
/**
20+
* @type {Cypress.PluginConfig}
21+
*/
22+
module.exports = (on) => {
23+
// on('file:preprocessor', webpack({ webpackOptions }))
24+
on('file:preprocessor', webpack({ }))
25+
}

0 commit comments

Comments
 (0)