0

I currently have all my tests in the root/test folder. Using blanket.js for code coverage works 100%. I want to move some of my tests into sub folders for example root/test/domainTests. However when doing this blanket.js does not find the test to run the coverage on. Is there an option i can set to point blanket.js to my tests? I have had a look around their site but cannot find anything useful.

current code in package.json - pattern points to my app files, not to the test files.

"config": {
  "blanket": {
    "pattern": "/domain/",
    "data-cover-never": "node_modules"
  }

I call it from the command line as follows

'mocha -r blanket -R html-cov > coverage.html'
SneakyPeet
  • 607
  • 5
  • 14

1 Answers1

0

Put the proper paths in in package.json file. In your example you are pointing to a folder, I think it needs to be a path that can locate the files.

"config": {
    "blanket": {
        "pattern": [
            "test/test1.js"
            "test/domain/test2.js"
        ]
    }
}

Also notice that you can use array for pattern property value if you need to specify more than one value (i.e. you moved only some of the tests, not all). Also wildcards (*) should also work for pattern values.

RaYell
  • 69,610
  • 20
  • 126
  • 152
  • Pattern points to the files in my app not to the test files. I did try what you suggested however no luck. I was thinking maybe there is another option for setting the test file location? – SneakyPeet Jul 15 '14 at 06:40