Skip to content

Commit ea57244

Browse files
authored
try jest (#31)
* try jest * fix: workflow * fix: workflow * fix: workflow * fix: contributing docs
1 parent 402165b commit ea57244

File tree

7 files changed

+4337
-1941
lines changed

7 files changed

+4337
-1941
lines changed

Diff for: .github/workflows/run-tests.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Run Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use Node.js 14
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 14
16+
- run: npm i
17+
- run: npm run test
18+
- run: npm run test-integration

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,5 @@ typings/
6262

6363
test/integration/node_modules
6464
test/integration/output
65+
coverage
6566

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ setTestHost(process.env.TEST_HOST);
159159

160160
Please send your config hooks!
161161

162-
If you feel that `codecept.conf.js` becomes too complicated and you know how to make it simpler,
162+
If you feel that `codecept.conf.js` becomes too complicated, and you know how to make it simpler,
163163
send a pull request with a config hook to solve your case.
164164

165165
Good ideas for config hooks:
@@ -174,8 +174,8 @@ To create a custom hook follow this rules.
174174
2. Create a js module that exports a function.
175175
3. Require `config` object from `codeceptjs` package.
176176
4. Use `config.addHook((config) => {})` to set a hook for configuration
177-
5. Add a test to `index_test.js`
178-
6. Run `mocha index_test.js`
177+
5. Add a test to `index.test.js`
178+
6. Run `npm run test`
179179

180180
See current hooks as examples.
181181

Diff for: hooks/setWindowSize.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ module.exports = function(width, height) {
1010

1111
// prepare window for a browser
1212
cfg.helpers.Puppeteer.chrome = merge(
13-
cfg.helpers.Puppeteer.chrome || {},
14-
{ args, defaultViewport: null, } // disables viewport emualtion. See https://github.com/Codeception/CodeceptJS/issues/1209#issuecomment-522487793
13+
cfg.helpers.Puppeteer.chrome || {},
14+
{ args, defaultViewport: null, } // disables viewport emulation. See https://github.com/Codeception/CodeceptJS/issues/1209#issuecomment-522487793
1515
);
1616
}
1717

0 commit comments

Comments
 (0)