Open searls opened 8 years ago
Teenytest seems to run OK on windows as evidenced by this https://ci.appveyor.com/project/searls/test-smells/build/1.0.37
I think the core issue is our build won't itself work on Windows b/c of all the unix hackery
Documenting my Windows experience. Maybe this can go in a wiki page the README.md can point to. There have been a number of changes in the tests since this issue was opened. Hopefully this can be helpful. The main issues encountered:
It is recommended to have Windows Subsystem for Linux (wsl) installed. This provides a complete Linux environment. It also provides a Windows native version of bash.
-c core.autocrlf=false -c core.eol=lf -c core.symlinks=true
on the git command. If symlinks can not be created, you will get error messages such as error: unable to create symlink example/esm-node/node_modules/.bin/teenytest: Permission denied
. There are eight symlinks (a workaround is described below).bash -c "git -c core.autocrlf=false -c core.eol=lf -c core.symlinks=true clone https://github.com/<your github id>/teenytest.git"
. This will create the symlinks and proper linefeed.
test:safe
and test:safe:bats
will not run.bash -c "npm run test"
. The tests will run if cloned in wsl or bash.
test:safe
- change package.json
to "test:safe": "node ./safe/support/runner.js",
test:safe:bats
- this requires bash, so either change package.json
to "test:safe:bats": "bash -c 'bats --tap --recursive safe'"
, or always run with bash -c "npm run test:safe:bats"
.bin/teenytest
and safe\teenytest.bats
must be saved with lineend = lf.../plugins/*printer*
to ../../vanilla/plugins/*printer*
(4 files).example\esm-node\package.json
needs to specify "test": "node ../../bin/teenytest"
example\*\node_modules\.bin\teenytest
need to specify ../../bin/teenytest "$@"
.Regarding the previous comment, several items under Making it Work
can be done and should not cause a problem for any platform.
There are other win32 issues with child_process.spawn that other issues linked in this issue mention. These will be addressed separately.
PRs #74 and #75 have been opened to improve Windows support.
Hi @webstech -- thanks for putting in the effort to get us closer here. I merged your two PRs and added a github action to monitor progress. I also updated all dependencies and cut a release as v6.0.4
@webstech Here's an example of where the windows build is failing in CI https://github.com/testdouble/teenytest/actions/runs/4156748629/jobs/7190751458
@searls I opened a PR implementing the changes listed above under 'Making it Work'. No issue if you disagree with the directions I chose - just trying to get it to work.
I noticed a difference in the tests between platforms that I have not researched. test:unit
has 9 tests on bashy platforms and 10 tests on Windows. The missing test is:
ok 10 - "counts the number of deeply nested things with 'type' test" - test #1 in `test/plugins/tap13/count-tests-test.js`
Seems like **
in the glob did not get the multi-level subdirs.
I mistakenly thought this repo had Appveyor set up already (like scripty does).
Things teenytest should do: