Skip to content

Commit 591355c

Browse files
authored
refactoring prepare for vscode-jest integration (#9)
see PR #9 for detail
1 parent 171f845 commit 591355c

38 files changed

+3425
-1661
lines changed

.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
env: {
3+
es6: true,
4+
node: true,
5+
browser: true,
6+
jest: true,
7+
},
8+
extends: ['airbnb-base', 'plugin:flowtype/recommended', 'prettier', 'plugin:prettier/recommended'],
9+
globals: {
10+
Atomics: 'readonly',
11+
SharedArrayBuffer: 'readonly',
12+
},
13+
parserOptions: {
14+
ecmaVersion: 2018,
15+
sourceType: 'module',
16+
},
17+
plugins: ['flowtype', 'prettier'],
18+
rules: {
19+
'prettier/prettier': 'error',
20+
'no-underscore-dangle': 'off',
21+
'camelcase': 'off',
22+
'no-param-reassign': ["error", { "props": false }],
23+
},
24+
};

.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ flow-typed
1111
[lints]
1212

1313
[options]
14+
esproposal.optional_chaining=enable
1415

1516
[strict]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
build/
3+
coverage/

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: node_js
2+
node_js:
3+
- "6"
4+
script:
5+
- yarn ci
6+
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
7+
- yarn danger ci
8+
- yarn prepublish

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"typescript.validate.enable": false,
3+
"javascript.validate.enable": false,
4+
"eslint.autoFixOnSave": true
5+
}

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
<!--
2+
3+
Please add your own contribution below inside the Master section
4+
Bug-fixes within the same version aren't needed
5+
6+
## Master
7+
8+
9+
* incorporate `jest-test-typescript-parser` into this package since it has been deprecated from the original `jest` reposition (#9) - connectdotz
10+
11+
projects that link with this package no longer need to add `jest-test-typescript-parser` package separately. The newly exposed `parse` function can select the proper parser based on file extension.
12+
13+
* fix a few race condition errors in Runner (#9) - connectdotz
14+
- concurrent Runner output to the same hard coded output file: added optional 'outputFileSuffix' parameter.
15+
- jest process output parser sometimes failed to identify testResults message.
16+
17+
* `TestReconciler` will now report test locations from jest '--testLocationInResults' output
18+
19+
* Snapshot parsing error will no longer throw but returns empty result. (#9) - connectdotz
20+
21+
Turning on the verbose will output caught exception for debugging purpose.
22+
23+
* upgrade to the latest jest version (24.7.x) - connectdotz
24+
25+
-->
26+
127
### 25.0.0
228

329
This is the first release that is de-coupled from the Jest release cycle. So,

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# jest-editor-support
22

3+
[![Build Status](https://travis-ci.com/jest-community/jest-editor-support.svg?branch=master)](https://travis-ci.com/jest-community/jest-editor-support)
4+
[![Coverage Status](https://coveralls.io/repos/github/jest-community/jest-editor-support/badge.svg?branch=master)](https://coveralls.io/github/jest-community/jest-editor-support?branch=master)
5+
6+
37
The engine that allows editors to build on top of Jest.
48

59
## Usage

babel.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
module.exports = {
42
presets: ['@babel/preset-env', '@babel/flow'],
53
};

dangerfile.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { danger, fail } from 'danger'
2+
import * as fs from 'fs'
3+
4+
const pr = danger.github.pr
5+
const modified = danger.git.modified_files
6+
const bodyAndTitle = (pr.body + pr.title).toLowerCase()
7+
const trivialPR = bodyAndTitle.includes('#trivial')
8+
9+
const codeOnly = (file ) => file.endsWith('.js')
10+
const filesOnly = (file) => fs.existsSync(file) && fs.lstatSync(file).isFile()
11+
12+
// Custom subsets of known files
13+
const modifiedAppFiles = modified.filter(p => p.includes('src/')).filter(p => filesOnly(p) && codeOnly(p))
14+
15+
// Rules
16+
17+
// When there are app-changes and it's not a PR marked as trivial, expect
18+
// there to be CHANGELOG changes.
19+
const changelogChanges = modified.includes('CHANGELOG.md')
20+
if (modifiedAppFiles.length > 0 && !trivialPR && !changelogChanges) {
21+
fail(
22+
'**No CHANGELOG added.** If this is a small PR, or a bug-fix for an unreleased bug add `#trivial` to your PR message and re-run CI.'
23+
)
24+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"numFailedTestSuites": 0,
3+
"numFailedTests": 0,
4+
"numPassedTestSuites": 1,
5+
"numPassedTests": 2,
6+
"numPendingTestSuites": 0,
7+
"numPendingTests": 0,
8+
"numRuntimeErrorTestSuites": 0,
9+
"numTodoTests": 0,
10+
"numTotalTestSuites": 1,
11+
"numTotalTests": 2,
12+
"openHandles": [],
13+
"snapshot": {
14+
"added": 0,
15+
"didUpdate": false,
16+
"failure": false,
17+
"filesAdded": 0,
18+
"filesRemoved": 0,
19+
"filesUnmatched": 0,
20+
"filesUpdated": 0,
21+
"matched": 0,
22+
"total": 0,
23+
"unchecked": 0,
24+
"uncheckedKeysByFile": [],
25+
"unmatched": 0,
26+
"updated": 0
27+
},
28+
"startTime": 1555506155123,
29+
"success": true,
30+
"testResults": [
31+
{
32+
"assertionResults": [
33+
{
34+
"ancestorTitles": [
35+
"setup"
36+
],
37+
"failureMessages": [],
38+
"fullName": "setup sets itself up fom the constructor",
39+
"location": {
40+
"column": 2,
41+
"line": 15
42+
},
43+
"status": "passed",
44+
"title": "sets itself up fom the constructor"
45+
},
46+
{
47+
"ancestorTitles": [
48+
"setup"
49+
],
50+
"failureMessages": [],
51+
"fullName": "setup can safe guard outputFileSuffix",
52+
"location": {
53+
"column": 2,
54+
"line": 25
55+
},
56+
"status": "passed",
57+
"title": "can safe guard outputFileSuffix"
58+
}
59+
],
60+
"endTime": 1555506157421,
61+
"message": "",
62+
"name": "/Users/vsun/ConnectDotz/External/jest-editor-support/src/__tests__/project_workspace.test.js",
63+
"startTime": 1555506155975,
64+
"status": "passed",
65+
"summary": ""
66+
}
67+
],
68+
"wasInterrupted": false
69+
}

0 commit comments

Comments
 (0)