Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run npm run test locally #164

Closed
Snailedlt opened this issue Nov 17, 2022 · 7 comments
Closed

Unable to run npm run test locally #164

Snailedlt opened this issue Nov 17, 2022 · 7 comments
Labels
awaiting user Needs more information from OP. bug Something isn't working question Further information is requested

Comments

@Snailedlt
Copy link
Contributor

I tried testing the feature I'm implementing in #163 , but when running npm run test I get the following error: No test files found, exiting with code 1

screenshot:
image

text:

PS D:\code\svelte-multiselect> npm run test

> svelte-multiselect@8.0.4 test
> vitest --run --coverage tests/unit/*.ts && playwright test tests/*.test.ts


 RUN  v0.25.1 D:/code/svelte-multiselect
      Coverage enabled with c8

filter:  tests/unit/*.ts
include: **/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}
exclude:  **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, 
**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.*
watch exclude:  **/node_modules/**, **/dist/**

No test files found, exiting with code 1
@Snailedlt
Copy link
Contributor Author

This is on the main branch btw.

Maybe the cause is a missing config file for playwright and vitest?

Snailedlt added a commit to Snailedlt/svelte-multiselect that referenced this issue Nov 17, 2022
@Snailedlt
Copy link
Contributor Author

Changed to pnpm test but still getting an error:
image

PS D:\code\svelte-multiselect> pnpm test             

> svelte-multiselect@8.0.4 test D:\code\svelte-multiselect
> vitest --run --coverage tests/unit/*.ts && playwright test tests/*.test.ts


 RUN  v0.25.1 D:/code/svelte-multiselect
      Coverage enabled with c8

filter:  tests/unit/*.ts
include: **/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}
exclude:  **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, 
**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.*
watch exclude:  **/node_modules/**, **/dist/**

No test files found, exiting with code 1
 ELIFECYCLE  Test failed. See above for more details.
 ```

@janosh
Copy link
Owner

janosh commented Nov 17, 2022

Maybe this is a Windows issue? Does it work if you replace backward with forward slashes?

vitest --run --coverage tests\unit\*.ts && playwright test tests\*.test.ts

@janosh janosh added bug Something isn't working question Further information is requested awaiting user Needs more information from OP. labels Nov 17, 2022
@Snailedlt
Copy link
Contributor Author

Snailedlt commented Nov 18, 2022

@janosh Nope, that caused an escape character error, so I tried to escape the backslashes, but I get the same error.

I tried the following to no avail:

vitest --run --coverage tests\unit\*.ts && playwright test tests\*.test.ts
vitest --run --coverage tests\\unit\\*.ts && playwright test tests\\*.test.ts
vitest --run --coverage ./tests/unit/*.ts && playwright test ./tests/*.test.ts
vitest --run --coverage *tests/unit/*.ts && playwright test *tests/*.test.ts

@janosh
Copy link
Owner

janosh commented Nov 18, 2022

What about quoting the paths? Maybe it's a shell expansion issue.

vitest --run --coverage 'tests/unit/*.ts' && playwright test 'tests/*.test.ts'

janosh added a commit that referenced this issue Nov 18, 2022
* Add new prop: `disableRemoveButton`
fix #163

* Add documentation for `disableRemoveButton`
fix #163

* Add example for `disableRemoveButton`
fix #163

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix numbering in readme

* Change comment on how to run tests
related #164

* Fix ts linting error on import

* fix tests and pre-commit.ci

Error: Cannot find module '/home/runner/work/svelte-multiselect/svelte-multiselect/src/options' imported from /home/runner/work/svelte-multiselect/svelte-multiselect/tests/multiselect.test.ts

pre-commit.ci:
- hook id: codespell
- exit code: 65

src/options.ts:61: FO ==> OF, FOR, TO, DO, GO
src/options.ts:61: RO ==> TO, ROW, ROB, ROD, ROE, ROT

* Change from disableRemoveBtn to minSelect
As described here:
#163 (comment)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* move minSelect readme docs to alphabetical order

* tweak minSelect section in Examples.svelte

* add test 'does not render remove buttons if selected.length <= minSelect'

* update repl_url for minSelect example

Co-authored-by: Janosh Riebesell <janosh.riebesell@gmail.com>
@Snailedlt
Copy link
Contributor Author

Hmm, maybe... I'll try that next :)

@janosh
Copy link
Owner

janosh commented Dec 25, 2022

Closing this as resolved assuming it was a shell expansion issue. Feel free to reopen if not.

@janosh janosh closed this as completed Dec 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting user Needs more information from OP. bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants