Closed FDiskas closed 4 years ago
Seems like you fixed the paths issue, but broke quite a few tests. Why did you remove those console.log.restore()
's?
Console restore IMO should be after test. In case of exeption or test failure console is not restored. Also in case --watch
it also errors about it
Also tests are failed in local computer on mac. Installed nothing changed ant fails. :/
@FDiskas currently it requires CI=true
env var to make tests pass because of the changes to chalk
that strips colors only in CI (still haven't gotten around to fixing that).
On restoring it after all tests - that's possible but would require full test suite rewrite. So is making it usable via --watch
. If you want to give it a shot - be my guest :)
Also in bedt scenario console should be restored afterEatch
And also use jest spyon
it('calls console.log with "hello"', () => { const consoleSpy = jest.spyOn(console, 'log'); console.log('hello'); expect(consoleSpy).toHaveBeenCalledWith('hello'); });
About CI=true This could be set as ENV in repo settings
@FDiskas there is 102 different little things that could be improved within this project - using jest.spyOn
instead of sinon, making tests --watch
-friendly, migrating from inquirer
to more modern equirer
, etc, etc, etc.
And I'm all up for that, but don't have enough time for just about anything.
If you want to tackle those - as I've said, be my guest! But please make a separate PR for each of those if you have time for that :)
Re: CI flag - it shouldn't be needed at all, it was a dirty temporary fix to ship a hotfix for CLI. We already have testing
environment setting that should strip colors by default. Again - I just didn't have time to address that.
@Tiim Reverted tests - sorry
@FDiskas looks good, thank you! ❤️
Lets try this one
Closes #284