jasmine: "fit" and "fdescribe" are ignored in jasmine-core >= 3.0.0 when run via Karma

How to reproduce: package.json:

{
  "name": "jasmine-core-fit-bug",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "jasmine-core": "^3.1.0",
    "karma": "^2.0.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-jasmine": "^1.1.1"
  }
}

karma.conf.js:

// Karma configuration
// Generated on Tue Mar 20 2018 11:36:08 GMT+0100 (CET)

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: [
      'spec/*.spec.js'
    ],


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


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },


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


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


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


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

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

spec/allspecs.spec.js:

it('makes sure that true is true', () => {
  expect(true).toBe(true);
});

fit('makes sure that false is false', () => {
  expect(false).toBe(false);
});

Expected output:

Chrome 65.0.3325 (Mac OS X 10.12.6): Executed 1 of 2 (skipped 1) SUCCESS (0.003 secs / 0 secs)

Actual output:

Chrome 65.0.3325 (Mac OS X 10.12.6): Executed 2 of 2 SUCCESS (0.006 secs / 0 secs)

It works, if you use jasmine-core in Version 2.9.1:

"jasmine-core": "^2.9.1",

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15 (6 by maintainers)

Most upvoted comments

I’ve seen this as well, but as far as I can tell the tests are still skipped, so fit and fdescribe are working but the bug is in the reporting.