Skip to content

Error running test from sub-package in monorepo #17

@eschiebel

Description

@eschiebel

I have a monorepo where testcafe and testcafe-testing-library files are in the top-level node_modules with links to the cli entry script installed in packages/sub-package/.bin. When I run testcafe tests that use testdafe-testing-library from the sub-package they fail with

$ testcafe chrome testcafe/**/*.test.js
ERROR Cannot prepare tests due to an error.

Error: ENOENT: no such file or directory, open 'node_modules/dom-testing-library/dist/dom-testing-library.umd.js'
    at Object.<anonymous> (/Users/eschiebel/exempt/src/canvas-lms/node_modules/testcafe-testing-library/dist/index.js:23:41)
    at Object.origExt [as .js] (/Users/eschiebel/exempt/src/canvas-lms/node_modules/testcafe/src/compiler/test-file/api-based.js:83:21)
    at Object.<anonymous> (/Users/eschiebel/exempt/src/canvas-lms/packages/canvas-rce/testcafe/RCEWrapper.test.js:21:1)
    at Function._compile [as _execAsModule] (/Users/eschiebel/exempt/src/canvas-lms/node_modules/testcafe/src/compiler/test-file/api-based.js:50:13)
    at ESNextTestFileCompiler._execAsModule [as _runCompiledCode] (/Users/eschiebel/exempt/src/canvas-lms/node_modules/testcafe/src/compiler/test-file/api-based.js:149:42)
    at ESNextTestFileCompiler._runCompiledCode [as execute] (/Users/eschiebel/exempt/src/canvas-lms/node_modules/testcafe/src/compiler/test-file/api-based.js:173:21)
    at ESNextTestFileCompiler.execute (/Users/eschiebel/exempt/src/canvas-lms/node_modules/testcafe/src/compiler/test-file/api-based.js:179:21)
    at compile (/Users/eschiebel/exempt/src/canvas-lms/node_modules/testcafe/src/compiler/index.js:98:31)
    at Compiler._getTests (/Users/eschiebel/exempt/src/canvas-lms/node_modules/testcafe/src/compiler/index.js:94:66)
    at _getTests (/Users/eschiebel/exempt/src/canvas-lms/node_modules/testcafe/src/compiler/index.js:110:35)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions