You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Karma recognizes and executes test-files in the directories matched by minimatch path (see config below).
Actual behaviour
After upgrading Karma from 1.5 to 3.0 neither wildcard /*.* nor extglob '/*.+(ts|tsx)' is working. Explicitely linking .ts files does work, doing so with .tsx files does not execute any tests provided in .tsx files. Linking single .tsx-files in the karma conf file array does work though!
Defining a Test.ts and a Test.tsx file in the project root and linking them via /*.(ts|tsx)also does work! More explicitely (paths are equal on files and preprocessors setting): packages/*/test/**/*.* - not working packages/*/test/**/*.+(ts|tsx) - not working packages/*/test/**/*.tsx - not working packages/*/test/**/*.ts - working, but only executes .ts test-files packages/core/test/security/SecurityWrapper.tsx - working, but requires explicit definition of all single .tsx test files
Tests execute as expected (if executed).
Test files (.ts and .tsx) are recognized by watcher, thus karma even reruns when changing a .tsx file, but is not executing the tests.
Environment Details
Karma version (output of karma --version): 3.0.0
Webpack version: 4.20.1
node.js version: 8.12.0
OS: Windows 8.1 Pro
Relevant part of your karma.config.js file
module.exports = function karmaConfig(config) {
config.set({
frameworks: ['mocha', 'intl-shim'],
reporters: ['spec','junit'],
files: [
//We need this, otherwise we will get an error, everytime we use "assign" with Redux
'./node_modules/phantomjs-polyfill-object-assign/object-assign-polyfill.js',
'./node_modules/babel-polyfill/browser.js',
'packages/*/test/**/*.*'
],
preprocessors: {
'packages/*/test/**/*.*':['webpack','sourcemap']
},
browsers: [
'PhantomJS'
],
port:9888,
webpack: require('./webpack.test.config.js'),
junitReporter: {
outputDir: 'reports/unittests'
}
});
};
The text was updated successfully, but these errors were encountered:
Yeah of course... Thanks for the tipp, investigating with loglevel debug made it. looks Like one of the test files is causing phantomjs to silently stop or crash: 17 10 2018 10:40:21.767:DEBUG [phantomjs.launcher]: TypeError: undefined is not an object (evaluating 'index_1.default.onReset')
Thank you so far, I think this can be closed since not karma related. Sorry for the false alert...
Expected behaviour
Karma recognizes and executes test-files in the directories matched by minimatch path (see config below).
Actual behaviour
After upgrading Karma from 1.5 to 3.0 neither wildcard
/*.*
nor extglob'/*.+(ts|tsx)'
is working. Explicitely linking .ts files does work, doing so with .tsx files does not execute any tests provided in .tsx files. Linking single .tsx-files in the karma conf file array does work though!Defining a Test.ts and a Test.tsx file in the project root and linking them via
/*.(ts|tsx)
also does work! More explicitely (paths are equal on files and preprocessors setting):packages/*/test/**/*.*
- not workingpackages/*/test/**/*.+(ts|tsx)
- not workingpackages/*/test/**/*.tsx
- not workingpackages/*/test/**/*.ts
- working, but only executes .ts test-filespackages/core/test/security/SecurityWrapper.tsx
- working, but requires explicit definition of all single .tsx test filesTests execute as expected (if executed).
Test files (.ts and .tsx) are recognized by watcher, thus karma even reruns when changing a .tsx file, but is not executing the tests.
Environment Details
karma --version
): 3.0.0karma.config.js
fileThe text was updated successfully, but these errors were encountered: