question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find test files

See original GitHub issue

Actual behavior

I can start karma, everything seems to run ok, but It doesn’t find any test files.

Enviroment Details

I’m using the following karma.config :

module.exports = function (config) {
    config.set({
        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: './'

        // frameworks to use
        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            'node_modules/angular2/bundles/angular2-polyfills.js', // Required for all major browsers
            'node_modules/es6-shim/es6-shim.min.js' // Required by PhantomJS2
        ],


        // list of files to exclude
        exclude: [],


        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {
            'dist/app/**/!(*.spec).js': ['coverage']
        },


        // test results reporter to use
        // possible values: 'dots', 'progress', 'mocha', 'coverage'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: ['mocha', 'coverage'],



    mochaReporter: {
      colors: {
        success: 'blue',
        info: 'bgGreen',
        warning: 'cyan',
        error: 'bgRed'
      }
    },


        // web server port
        port: 9876,


        // enable / disable colors in the output (reporters and logs)
        colors: true,


        // level of logging
        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
        logLevel: config.LOG_DEBUG,


        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: true,


        // start these browsers
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
        browsers: ['PhantomJS2'], // 'Chrome'


        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: true,


        // Concurrency level
        // how many browser should be started simultanous
        concurrency: Infinity
    })
}; 

I have a test files named as : app.spec.js for example all around in dist/app but when running it doesn’t find any.

Sorry for the code formatting, couldn’t get the `` to work properly.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stherrienaspnetcommented, Sep 22, 2018

Hello I’m facing a similar issue my tests are located under src/user/, as soon I move them to src/api/user karma is not able to find them anymore. Here is my karma config; module.exports = function (config) { config.set({ basePath: ‘’, frameworks: [“jasmine”, “karma-typescript”], files: [ “src//*.ts", ], preprocessors: { "/*.ts”: “karma-typescript” }, reporters: [“progress”, “coverage”, “karma-typescript”], browsers: [‘ChromeHeadless’], autoWatch: true, singleRun: false, concurrency: Infinity }); };

0reactions
devoto13commented, May 24, 2020

I hope you have resolved your issues by now. Please use StackOverflow for questions and support in the future as we want to keep issue tracker for bug reports and feature requests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Golang testing: "no test files" - Stack Overflow
It's possible you don't have any test files in the root package and running go test -v does not test sub-packages, only the...
Read more >
Why can't *_test.go files find functions defined in different files ...
This works fine with *.go files but not with *_test.go files. Goland's editor can see the function Dbconnect() because it displays the name ......
Read more >
Run test file addin does not find test file on Windows #2355
Here is the issue : Running the addin "Run a test file" will run devtools:::test_active_file() in R Console in the RStudio IDE.
Read more >
Error Messages | Cypress Documentation
Test File Errors No tests found This message means that Cypress was unable to find tests in the specified file. You'll likely get...
Read more >
No test files : r/golang - Reddit
go test is not restricted to test the go file in the folder. you can test ... in GoLand 2022.3 or GoLand 2022.2.5...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found