How can I tell Mocha where to look for my test files? My test files dont reside in the standard project root ./test folder. My test sit in Modules/.*/Tests/.
I've attempted to use the --grep command line argument but I have a feeling this argument looks for test NAMES not for test FILE NAMES.
mocha --grep Modules\/.*\/Tests
The above command gives the error:
Warning: Could not find any test files matching pattern: test
No test files found
You have to match not only directory but also its files . Besides, do no need grep , use only -- :
mocha -- Modules/**/Tests/*.js
// or `mocha -- Modules/Tests/*.js` (I am not sure because you didn't give the project hierarchy )
Related
I'm trying to find a way to print spec reporter output to a text file once the test suite is complete. I'm using WebdriverIO but none of the completion callbacks seem to provide any access to the actual report output. There's also no documentation on any config variable you can pass in to set a file output. There an outputDir option but it only writes the log before the actual report to the selected location.
My solution was to use tee to write all output of the test suite to a file and stdout. The report is then contained at the end of the file.
./node_modules/.bin/wdio wdio.conf.js | tee test-report.txt
For running individual tests run:
./node_modules/.bin/wdio wdio.conf.js -- --spec <Spec File Name> | tee test-report.txt
I am trying to configure collectCoverageFrom for jest to look up all my .ts files expect those with .module.ts but I can not find the correct glob pattern.
As peer what I understand this should work :
src/**/**.!(.module.ts).ts
but for some reason it does not takes files like this one:
src/pages/home/home.ts
What I am doing wrong?
Try this
src/**/!(*module)*.ts
You can test this glob pattern using globster https://globster.xyz/?q=**%2F!(module).ts
The solution was to use two rules ['src/**/*.ts','!**/*.module.ts']].
Looks like the second rule filters the first rule results: "Take all the *.ts files except(!) *.module.ts"
On other forum pages, I've seen that I can run specific hspec tests with the command
stack test --test-arguments "-m "<filter>""
where <filter> is set to match it's textual descriptor for the intended tests. I frequently use this command to run single tests of interest without having to run the entire test suite.
But I do not understand how exactly this command specifies that. For instance, what kind of argument is "-m "<filter>"", and what does that "-m" mean? What other arguments can be specified as the "-m "<filter>"" is here?
About --test-arguments, stack test --help | less says only
--ta,--test-arguments TEST_ARGS
Arguments passed in to the test suite program
which is the only relevant documentation I have found on how to specify stack to run a subset of tests.
ive been setting up Grunt for my web app to auto build it and im seeing paths like
/path/to/file/**/*.js
i understand what one wildcard means, but what does 2 in a row mean?
/path/to/file/**/*.js matches any number of directories between /path/to/file/ and /*.js. As opposed to /path/to/file/*/*.js, which matches a single directory between /path/to/file/ and /*.js.
this matchers called "glob pattern" they are widely used in shell script and in CLI tools like grunt or npm .they '**' means -- "Matches zero or more directories, but will never match the directories . and .. "
you can read more in the docs
glob pattern
I'm coding an extremely simple shell script and it doesn't really work as it should. Here are the contents:
# Defining base project directory
BASE_DIR=/path/to/proj;
PRODUCTION_DIR = $BASE_DIR/out/production/dir;
# Generating headers
javah -classpath $PRODUCTION_DIR -d $BASE_DIR/jni/include com.my.class.Name
# Building native libs
ndk-build
Paths are correct, it works if I remove $PRODUCTION_DIR, if I'll run it like this, it says:
line 3: PRODUCTION_DIR: command not found
...
Does any one know what's wrong?
Remove whitespace,
PRODUCTION_DIR=$BASE_DIR/out/production/dir
Otherwise you're trying to run PRODUCTION_DIR with parameters = and $BASE_DIR/out/production/dir
Also, remove the ;'s at end of line, they're redundant