Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Error when running test coverage: TypeError: this.timeout is not a function #316

Open
elenadimitrova opened this issue Mar 19, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@elenadimitrova
Copy link

elenadimitrova commented Mar 19, 2020

Some random errors after contract instrumentation have started happening since yesterday:

Instrumenting for coverage...
=============================

...
> server:            http://127.0.0.1:8545
Error: TypeError: this.timeout is not a function
    at Object.runCoverage (/Users/Elena/Source/argent-contracts/node_modules/etherlime/cli-commands/etherlime-test/etherlime-coverage.js:84:9)
etherlime coverage [path] [timeout] [port] [solcVersion] [workingDirectory]
[html] [ignoreFiles]

Run all tests with code coverage.

Sample failing build: https://circleci.com/gh/argentlabs/argent-contracts/289

Also

> server:            http://127.0.0.1:8545
Error: SyntaxError: Invalid or unexpected token
    at Object.runCoverage (/home/circleci/argent-contracts/node_modules/etherlime/cli-commands/etherlime-test/etherlime-coverage.js:84:9)
etherlime coverage [path] [timeout] [port] [solcVersion] [workingDirectory]
[html] [ignoreFiles]

Sample failing build: https://circleci.com/gh/argentlabs/argent-contracts/287

@ochikov ochikov self-assigned this Mar 19, 2020
@ochikov ochikov added the bug Something isn't working label Mar 19, 2020
@ochikov
Copy link
Collaborator

ochikov commented Mar 19, 2020

Thank you. I will investigate it.

@elenadimitrova
Copy link
Author

elenadimitrova commented Mar 19, 2020

I managed to narrow it down to changing the empty function declarations to use arrow syntax:

describe("Test Approved Transfer", function () {
=>
describe("Test Approved Transfer", () => {

This change is okay when running the mocha tests but not under coverage.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants