Since I changed from ava-ts back to ava with better TypeScript support, power assert seems to have stopped working. See output below.
Same with objects or anything else.
I would expect that it prints the incorrect value (so A.B.Tester in this case) and if it's an object then the entire object or the diff.
test('conversion - test createFullname method', async t => {
t.true(createFullname('A.B.', '', 'Tester') === 'A.B. Tester')
t.pass()
})
11: t.true(createFullname('A.B.', '', 'Tester') === 'A.B. Tester')
Value is not `true`:
false
ava.config.js:
export default {
"compileEnhancements": false, // Tried true as well
"extensions": [
"ts"
],
"require": [
"ts-node/register"
],
"files": [
"tests/*.test.ts"
]
}
Copy your npm build scripts or the ava command used:
Tell us which operating system you are using, as well as which versions of Node.js, npm, and AVA. Run the following to get it quickly:
Node.js v8.12.0
linux 4.15.0-34-generic
ava 1.0.0-beta.8
npm 6.4.1
Power Assert relies on compileEnhancements, which you can't use because you're using TypeScript.
(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)
Okay, can this be a feature request? I love power assert :)
I'm not quite sure how we'd combine the two. Perhaps something to revisit once we have more integrated TypeScript support.
Hi guys, I found a way to use power-assert and typescript with ava!
npm install -D espower-typescript ts-node ava
{
// package.json
"ava": {
"files": [
"test/**/*.test.ts"
],
"compileEnhancements": false,
"extensions": [
"ts"
],
"require": [
"ts-node/register",
"espower-typescript/guess"
]
}
}
Then just run:
$ TS_NODE_TRANSPILE_ONLY=1 npx ava
Doesn't work for me sadly :(
It just says that Value is not 'true' now for a t.true() assertion and the line number it shows is way off. Doesn't show any power assertion.
Most helpful comment
Doesn't work for me sadly :(
It just says that
Value is not 'true'now for a t.true() assertion and the line number it shows is way off. Doesn't show any power assertion.