pugjs/then-pug

sync tests with published jade version

Closed this issue · 4 comments

Make the test cases correspond to the latest released version of jade, not the version in master. They should be automatically downloaded from GitHub at the appropriate tag

@ForbesLindesay I do not fully understand because we need tests that are specific to the asynchrous case (the current gn-cases, gn beeing for "generators"

do you mean :

  • remove from the then-jade repo all the test cases that are handled in jade
  • find a way to automatically download the tests from jade at the appropriate tag (jade dependency & test should be at the same release I suppose ; frozen on official jade releases)
  • make sure both sets are run when we run tests

Yes, that is what I mean. We can use https://github.com/ForbesLindesay/gethub with the version number as the branch/tag (since all versions of jade are tagged) to do the download, then just run all of the files in jade/test/cases and check their output. We don't need to run any of the unit tests etc. from jade, but we should make sure we haven't broken any of those examples.

Tests are currently synced with upstream jade, but do not work on a fresh install.

Mocha tries to register the tests while the download is not yet finished. I have tried several things but mocha does not seem to like dynamically registered tests.

@ForbesLindesay do you think we could :

  • have a make file
  • have a target in the make file for the gethub download
  • make tests run this target before the tests

the then-jade yield tests now run both the specific then-jade tests + the "test/cases" tests from the upstream jade.

to detect which cases we need to download, we check in node_modules/jade/package.json (version) and download it via npm/gethub.

the download is done in a Makefile target because I could not find a way to define dynamic tests in mocha (we need to define the tests after the cases are downloaded).

I think I can close the issue for now. do not hesitate to re-open if there is a problem.