Given that i have added chai/require-expect to the require array in mocharc.yml
When i run npx mocha
Then it should include expect as a global function
-- Actually --
I get the following error:
TSError: ⨯ Unable to compile TypeScript: test/isthisforfun.spec.ts:7:9 - error TS2304: Cannot find name 'expect'.
mocharc.yml
allow-uncaught: false
async-only: false
bail: false
check-leaks: false
color: true
delay: false
diff: true
exit: false # could be expressed as "no-exit: true"
extension:
- ts
forbid-only: false
forbid-pending: false
full-trace: false
# fgrep and grep are mutually exclusive
# grep: something
growl: false
ignore:
- node_modules
- src
inline-diffs: false
# needs to be used with grep or fgrep
# invert: false
recursive: false
reporter: spec
require:
- "ts-node/register"
- "chai/register-expect"
retries: 1
slow: 75
sort: false
spec: test/**/*.spec.ts # the positional arguments!
timeout: false # same as "no-timeout: true" or "timeout: 0"
trace-warnings: true # node flags ok
ui: bdd
v8-stack-trace-limit: 100 # V8 flags are prepended with "v8-"
watch: false
watch-files:
- 'test/**/*.ts'
Given that i have added chai/require-expect to the require array in mocharc.yml When i run npx mocha Then it should include expect as a global function
-- Actually --
I get the following error:
TSError: ⨯ Unable to compile TypeScript: test/isthisforfun.spec.ts:7:9 - error TS2304: Cannot find name 'expect'.
mocharc.yml
tsconfig.json
package.json
Hack Fix If i include the library as an import in each test it passes