Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Conversation

@ralphtheninja
Copy link
Member

Turns out faucet is causing problems. Also don't need buster to run ts-node.

@ralphtheninja
Copy link
Member Author

ralphtheninja commented Sep 10, 2017

Supersedes #475

cc @MeirionHughes

@MeirionHughes
Copy link
Member

MeirionHughes commented Sep 10, 2017

Yeah, I was going to make the same change; but had to pop out this afternoon.

Mind if I pull from this fork to carry on? I still think there are a few refinements to be made before merger.

@ralphtheninja
Copy link
Member Author

@MeirionHughes Sure go ahead!

@vweevers
Copy link
Member

Instead of spawning a ts-node process for each test file, I suggest:

"scripts": {
    "test": "standard && node test | faucet && npm run ts-test",
    "ts-test": "ts-node --no-cache test"
}

Then in test/index.js:

const fs = require('fs')
const path = require('path')

fs.readdirSync(__dirname)
  .filter(f => /-test.js/.test(f))
  .forEach(f => require(path.join(__dirname, f)))

That's basically what tape was doing anyway, and this works for both node and ts-node. WDYT?

Also when I tested this, I had to do ts-node --no-cache to get it to pick up changes to the type definitions. Any harm to keeping that flag?

@ralphtheninja
Copy link
Member Author

@vweevers PR! 😉

@vweevers
Copy link
Member

Against which branch?

@ralphtheninja ralphtheninja merged commit 6e2603e into Level:master Sep 10, 2017
@ralphtheninja
Copy link
Member Author

@vweevers master

@ralphtheninja ralphtheninja deleted the tweak-ts-test branch September 10, 2017 22:14
@MeirionHughes
Copy link
Member

I've just pulled from upstream and I think this broke the test for me;

> [email protected] test D:\Code\levelup
> standard && tape test/*-test.js | faucet && npm run ts-test

module.js:491
    throw err;
    ^

Error: Cannot find module 'D:\Code\levelup\test\*-test.js'
... 

@vweevers
Copy link
Member

@MeirionHughes can you try my branch (#480)?

@MeirionHughes
Copy link
Member

just about to pull from it. :P

I wish github pr requests would give you the pull url for a pr. :D

@MeirionHughes
Copy link
Member

ahh, lol, you didn't fork. I was trying to add you as a remote. doh!

@MeirionHughes
Copy link
Member

@vweevers yes, that appears to have fixed it - its running on Win10

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants