Skip to content

Commit 3197138

Browse files
committed
[Tests] pre-build the tests, only in CI
1 parent 39a8774 commit 3197138

11 files changed

+242
-10
lines changed

.babelrc

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@
44
"@babel/preset-flow"
55
],
66
"plugins": [
7-
"@babel/plugin-transform-flow-strip-types"
8-
]
7+
"@babel/plugin-transform-flow-strip-types",
8+
],
9+
"env": {
10+
"test": {
11+
"plugins": [
12+
["module-resolver", {
13+
"root": ["./__tests__"],
14+
"alias": {
15+
"^axobject-query/src/(.*)": "./lib/\\1",
16+
}
17+
}]
18+
]
19+
},
20+
"development": {
21+
"plugins": [
22+
["module-resolver", {
23+
"root": ["./src"],
24+
"alias": {
25+
"^axobject-query/src/(.*)": "./src/\\1",
26+
}
27+
}]
28+
]
29+
},
30+
}
931
}

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ jobs:
1111
tests:
1212
uses: ljharb/actions/.github/workflows/node.yml@main
1313
with:
14-
range: '>= 0.4'
14+
range: '>= 0.8'
1515
type: majors
16-
command: npm run tests-only
16+
build-command: npm run build:tests
17+
build-output-dir: __tests-built__,lib
18+
command: npm run tests-built
1719

1820
flow:
1921
name: Flow type checking

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ reports/
44
docs/
55
.nyc_output/
66
coverage/
7+
__tests-built__/

__tests__/src/AXObjectElementMap-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'tape';
22
import deepEqual from 'deep-equal-json';
33
import inspect from 'object-inspect';
44

5-
import AXObjectElementMap from '../../src/AXObjectElementMap';
5+
import AXObjectElementMap from 'axobject-query/src/AXObjectElementMap';
66

77
const entriesList = [
88
["AbbrRole", [{"name": "abbr"}]],

__tests__/src/AXObjectRoleMap-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'tape';
22
import deepEqual from 'deep-equal-json';
33
import inspect from 'object-inspect';
44

5-
import AXObjectRoleMap from '../../src/AXObjectRoleMap';
5+
import AXObjectRoleMap from 'axobject-query/src/AXObjectRoleMap';
66

77
const entriesList = [
88
["AlertDialogRole", [{"name": "alertdialog"}]],

__tests__/src/AXObjectsMap-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'tape';
22
import deepEqual from 'deep-equal-json';
33
import inspect from 'object-inspect';
44

5-
import AXObjectsMap from '../../src/AXObjectsMap';
5+
import AXObjectsMap from 'axobject-query/src/AXObjectsMap';
66

77
const entriesList = [
88
["AbbrRole", {relatedConcepts: [{module: 'HTML',concept: {name: 'abbr',},},],type: 'structure',}],

__tests__/src/elementAXObjectMap-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'tape';
22
import deepEqual from 'deep-equal-json';
33
import inspect from 'object-inspect';
44

5-
import elementAXObjectMap from '../../src/elementAXObjectMap';
5+
import elementAXObjectMap from 'axobject-query/src/elementAXObjectMap';
66

77
const entriesList = [
88
[{"name": "abbr"}, ["AbbrRole"]],

__tests__/src/util/iterationDecorator-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'tape';
22
import values from 'object.values';
33
import mockProperty from 'mock-property';
44

5-
import iterationDecorator from '../../../src/util/iterationDecorator';
5+
import iterationDecorator from 'axobject-query/src/util/iterationDecorator';
66

77
test('iterationDecorator', (t) => {
88
t.test('adds a Symbol.iterator property to a collection', async (st) => {

__tests__/src/util/iteratorProxy-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'tape';
22

3-
import iteratorProxy from '../../../src/util/iteratorProxy';
3+
import iteratorProxy from 'axobject-query/src/util/iteratorProxy';
44

55
test('iteratorProxy', async (t) => {
66
const arr = ['a', 'b', 'c'];

package-lock.json

Lines changed: 204 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)