SweetIQ/schemats

When runned locally, tests are looking for osm.ts at wrong location

abenhamdine opened this issue · 2 comments

Hi and thx again for this module !

While running tests locally before submitting a PR, I ran into the following pb : tests are looking for file osm.ts in test/artifacts/osm.ts, but this file is actually located at test/example/osm.ts

image

The culprit seems to be https://github.com/SweetIQ/schemats/blob/master/test/test.ts#L59

xiamx commented

test/example/osm.ts is file that we want schemats to generate from osm.sql. and test/artifacts/osm.ts is the file schemats actually generates. We run the diff for the two files, tests pass if those two files are line-by-line equal.

The problem is that since test/artifacts directory is missing (I forgot to commit it to the repo), test/artifacts/osm.ts wasn't written. The promise in https://github.com/SweetIQ/schemats/blob/master/test/test.ts#L12 shouldn't resolve, and we should be able to catch that as a file failed to write error.. but I don't know why it didn't.

Ah ok thx a lot 👍
It could be useful to add a few lines in the readme just to precise that the file test/example/osm.ts is the one to be edited for the tests.