Skip to content

Commit ae4a898

Browse files
mrtnvhbenmonro
authored andcommitted
fix(UMD path): Find dom-library with require.resolve (#23)
Closes #17
1 parent 115de75 commit ae4a898

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"build": "kcd-scripts build",
1010
"lint": "kcd-scripts lint",
1111
"test:unit": "kcd-scripts test --no-watch --config=jest.config.js",
12+
"test:unit:monorepo": "cd tests/unit && kcd-scripts test --no-watch --config=../../jest.config.js",
1213
"test:testcafe:serve": "serve --listen 13370 ./test-app",
1314
"test:testcafe:run": "testcafe --skip-js-errors",
1415
"validate": "kcd-scripts validate build,lint,test",
1516
"test:testcafe": "npm-run-all --silent --parallel --race test:testcafe:serve test:testcafe:run",
16-
"test": "npm-run-all --parallel test:unit test:testcafe",
17+
"test": "npm-run-all --parallel test:unit test:unit:monorepo test:testcafe",
1718
"semantic-release": "semantic-release"
1819
},
1920
"files": [
@@ -40,4 +41,4 @@
4041
"type": "git",
4142
"url": "https://github.com/testing-library/testcafe-testing-library.git"
4243
}
43-
}
44+
}

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import { ClientFunction, Selector } from 'testcafe'
66
import { queries } from '@testing-library/dom'
77

88
const DOM_TESTING_LIBRARY_UMD_PATH = path.join(
9-
'./node_modules',
10-
'@testing-library/dom/dist/@testing-library/dom.umd.js',
9+
require.resolve( '@testing-library/dom' ),
10+
'../../',
11+
'dist/@testing-library/dom.umd.js',
1112
)
1213
const DOM_TESTING_LIBRARY_UMD = fs.readFileSync(DOM_TESTING_LIBRARY_UMD_PATH).toString()
1314

0 commit comments

Comments
 (0)