'Separate unit tests and integration tests with Hardhat and NPM
I am trying to setup in my package.json two commands for starting my unit tests and integration tests, but I am having difficulties in specifying a testset (location) for these two types of testing.
In my package.json in scripts section I have created two commands for unit tests and integration tests:
…
….
“unit”: “hardhat test test/unit/**/*.test.ts”,
“integration”: “hardhat test test/integration/**/*.inttest.ts”
….
But hardhat test task does not seem to handle the wildcard specification well. It only executes test files which are directly within the directory integration (for integration test case). It is not (recursively) executing test files in subfolders (descendants) of the integration directory.
So, I suspect that this limitation is in the implementation of the test task of Hardhat. Does any one knows how to specify a command which executes all test files in all descendant folders of unit directory or integration directory?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
