karma-runner / karma-runner/karma

more than one spec.js file, karma is not working properly

Open
#3,129 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Expected behaviour
I am new to require.js with karma.
my tree s like below
![image](https://user-images.githubusercontent.com/22405895/45318799-97234300-b503-11e8-8da2-8e9ce1582706.png)

it should pass all the tests.
### Actual behaviour
when there is one spec.js for example aSpec.js it is running fine.
when adding an other spec.js, karma is not running properly and giving errors in aSpec.js. This is weird.

### Environment Details
frameworks: ['jasmine', 'requirejs'],

- Karma version (output of `karma --version`):
![image](https://user-images.githubusercontent.com/22405895/45318638-29771700-b503-11e8-9c94-11568f1c15fc.png)

- Relevant part of your `karma.config.js` file
module.exports = function (config) {
config.set({

// base path, that will be used to resolve files and exclude
basePath: '',

// frameworks to use
frameworks: ['jasmine', 'requirejs'],

// list of files / patterns to load in the browser
files: [
{pattern: 'test/**/*Spec.js', included: false},
{pattern: 'src/**/*.js', included: false},
'submit_po3_validations.js',
'ups_lib.js',
'submit_po3.js',
'so_entry_checks_client.js',
'so_entry_checks_ue.js',
'./test/test_so_ue.js',
'submit_lib.js',
'library.js',
'set_dc_on_so_ue.js',
'set_cust_info_ue.js',
'send_email_to_customer.js',
'create_marketplace_cust_dep_ue.js',
'./test/test_library.js',
'./test/test_set_cust_info_ue.js',
'./test/test_send_email_to_customer.js',
'./test/submit_po_tests.js',
'./test/submit_po_validations_tests.js',
'./test/test_so_entry_checks_client.js',
'./test/submit_lib_tests.js',
'./test/TestSetDCSalesOrder.js',
'./test/ups_lib_tests.js',
'./test/test_create_marketplace_cust_dep_ue.js',
'test/test-main.js',
],

exclude: [
],

reporters: ['dots', 'junit'],

// 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_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
browsers: [//'PhantomJS',
'Chrome'],

captureTimeout: 60000,

// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: true
});
};

Any ideas what is going on here.
Thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.