Skip to content

Enhancement: extend the test npm script with checking Node version #2181

@waldekmastykarz

Description

@waldekmastykarz

Since we require Node@14 to get correct code coverage, we should verify that the test script is execute on Node@14. If the script is executed on a different Node version, we should throw an error and not run tests.

We could implement it by adding a new script to the script folder that checks that the current major Node version is 14. If the version is different, it writes an error using console.error and returns a non-0 exit code to signal failture.
Then, we'd add this script to the test npm script, like node scripts/check-version.js && c8 mocha \"dist/**/*.spec.js\" --timeout 10000 so that tests are executed only if checking Node version succeeded.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions