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.

Not able to run stryker with a really simple spec

See original GitHub issue

Hi

I am using stryker with karma runner and jasmine. Here is my config file

module.exports = function(config) {
    config.set({
        // list of files / patterns to load in the browser
        files: [
           './thirdparty/js/require/require-1.0.8.js',
            './tests/CanarySpec.js'
        ],
        // level of logging
        logLevel: config.LOG_DEBUG,
        testRunner: 'karma',
	testFramework:'jasmine',

            karmaConfig: {
            frameworks: ['requirejs'],
            browsers: ['PhantomJS'],
	    reporter: ['html','progress'],
        }

    });
};

Here is CanarySpec.

define("tests/CanarySpec",[],function(){
    function helloWorld() {
        return "Hello world!";
    }
    describe('Hello world', function() {
        it('says hello', function() {
            expect(helloWorld()).toEqual("Hello world!");
        });
    });
});

I am getting following error



> stryker -c stryker.conf.js

[2016-11-10 01:52:34.761] [DEBUG] PluginLoader - Loading plugins stryker-html-reporter (matched with expression stryker-*)
[2016-11-10 01:52:34.761] [DEBUG] PluginLoader - Loading plugins stryker-karma-runner (matched with expression stryker-*)
[2016-11-10 01:52:34.761] [DEBUG] PluginLoader - Loading plugins stryker-html-reporter
[2016-11-10 01:52:34.871] [DEBUG] PluginLoader - Loading plugins stryker-karma-runner
[2016-11-10 01:52:35.822] [DEBUG] Stryker - Using config: {"testFramework":"jasmine","testRunner":"karma","timeoutMs":5000,"timeoutFactor":1.5,"plugins":["stryker-*"],"port":9234,"reporter":["progress","clear-text"],"files":["thirdparty/js/require/require-1.0.8.js","tests/CanarySpec.js"],"singleRun":true,"karmaConfig":{"frameworks":["requirejs"],"browsers":["PhantomJS"],"reporter":["html","progress"]},"configFile":"stryker.conf.js"}
[2016-11-10 01:52:35.822] [DEBUG] TestSelectorOrchestrator - Using testSelector jasmine based on `testFramework` setting
[2016-11-10 01:52:35.838] [WARN] InputFileResolver - No files marked to be mutated, stryker will perform a dry-run without actually mutating anything.
[2016-11-10 01:52:35.838] [INFO] TestRunnerOrchestrator - Starting initial test run. This may take a while.
[2016-11-10 01:52:35.838] [DEBUG] TestRunnerOrchestrator - Creating a sandbox for files in ~\html5\.stryker-tmp\9069590\test-runner-files7967011
[2016-11-10 01:52:35.838] [DEBUG] TestRunnerOrchestrator - Creating test runner 0 using settings {port: 9234, coverageEnabled: true}
[2016-11-10 01:52:36.072] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:36.071] [DEBUG] PluginLoader - Loading stryker-* from ~\html5\node_modules

[2016-11-10 01:52:36.087] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:36.087] [DEBUG] PluginLoader - Loading plugins stryker-html-reporter (matched with expression stryker-*)

[2016-11-10 01:52:36.087] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:36.087] [DEBUG] PluginLoader - Loading plugins stryker-karma-runner (matched with expression stryker-*)

[2016-11-10 01:52:36.087] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:36.087] [DEBUG] PluginLoader - Loading plugins stryker-html-reporter

[2016-11-10 01:52:36.197] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:36.196] [DEBUG] PluginLoader - Loading plugins stryker-karma-runner

[2016-11-10 01:52:37.086] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:37.085] [INFO] KarmaTestRunner - using config 
....
....

[2016-11-10 01:52:37.694] [TRACE] IsolatedTestRunnerAdapter - 10 11 2016 01:52:37.678:WARN [watcher]: Pattern "~/html5/.stryker-tmp/9069590/test-runner-files7967011/___testSelection.js" does not match any file.

[2016-11-10 01:52:37.710] [TRACE] IsolatedTestRunnerAdapter - 10 11 2016 01:52:37.709:INFO [karma]: Karma v1.3.0 server started at http://localhost:9234/

[2016-11-10 01:52:37.710] [TRACE] IsolatedTestRunnerAdapter - 10 11 2016 01:52:37.709:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency

[2016-11-10 01:52:37.741] [TRACE] IsolatedTestRunnerAdapter - 10 11 2016 01:52:37.740:INFO [launcher]: Starting browser PhantomJS

[2016-11-10 01:52:39.348] [TRACE] IsolatedTestRunnerAdapter - 10 11 2016 01:52:39.347:INFO [PhantomJS 2.1.1 (Windows 7 0.0.0)]: Connected on socket /#HeVZwJH9cHyEyEcZAAAA with id 26839638

[2016-11-10 01:52:49.602] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:49.585] [DEBUG] PluginLoader - Loading stryker-* from ~\html5\node_modules

[2016-11-10 01:52:49.602] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:49.601] [DEBUG] PluginLoader - Loading plugins stryker-html-reporter (matched with expression stryker-*)

[2016-11-10 01:52:49.602] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:49.601] [DEBUG] PluginLoader - Loading plugins stryker-karma-runner (matched with expression stryker-*)

[2016-11-10 01:52:49.602] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:49.601] [DEBUG] PluginLoader - Loading plugins stryker-html-reporter

[2016-11-10 01:52:49.726] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:49.726] [DEBUG] PluginLoader - Loading plugins stryker-karma-runner

[2016-11-10 01:52:50.664] [TRACE] IsolatedTestRunnerAdapter - [2016-11-10 01:52:50.664] [INFO] KarmaTestRunner - using config {"browsers":["PhantomJS"],"frameworks":["requirejs"],"autoWatch":false,"singleRun":false,"detached":false,"reporter":["html","progress"],"files":
.....
.....

[2016-11-10 01:52:51.275] [TRACE] IsolatedTestRunnerAdapter - 10 11 2016 01:52:51.274:INFO [karma]: Karma v1.3.0 server started at http://localhost:9234/

[2016-11-10 01:52:51.275] [TRACE] IsolatedTestRunnerAdapter - 10 11 2016 01:52:51.274:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency

[2016-11-10 01:52:51.290] [TRACE] IsolatedTestRunnerAdapter - 10 11 2016 01:52:51.290:INFO [launcher]: Starting browser PhantomJS

[2016-11-10 01:52:52.884] [TRACE] IsolatedTestRunnerAdapter - 10 11 2016 01:52:52.883:INFO [PhantomJS 2.1.1 (Windows 7 0.0.0)]: Connected on socket /#me0jBb0I_CmAKeanAAAA with id 98884965

[2016-11-10 01:52:52.884] [ERROR] stryker-cli - an error occurred [Error: There were failed tests in the initial test run]
Error: There were failed tests in the initial test run
    at ~\html5\node_modules\stryker\src\Stryker.js:58:23
    at run .....
	......

Is there a way to know why tests are failing or any other pointer to diagnose further please?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mthmulderscommented, Dec 16, 2016

I can confirm it is fixed since 0.5.4. Thanks!

0reactions
nicojscommented, Dec 16, 2016

@arpitgautam

A side note: if you’re using karmaConfig: { frameworks: ['requirejs'] } you should not also add './thirdparty/js/require/require-1.0.8.js', to your files. The karma configuration will provide requirejs for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discussion: Performance testing · Issue #2434 - GitHub
It is very much possible to execute performance tests on a lower level. We could even make it low level enough that Stryker...
Read more >
Configuration | Stryker Mutator
You run stryker from the test project directory. On some dotnet core projects stryker can run without specifying any custom configuration.
Read more >
Correct configuration for Stryker on Angular v11 Library project?
I have had no issue with setting up and running Stryker on an application project using default settings for Karma. I am having...
Read more >
stryker-mutator/stryker - Gitter
I'm not sure how the mutation tests are run, but I assume you run every mutation in isolation. If you tell jest which...
Read more >
Introduction to Mutation Testing with Stryker - Medium
It does not check that our tests are actually able to detect faults in the executed ... can be extremely time consuming and...
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