Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec selection does not work anymore #282

Open
kkoo95 opened this issue Dec 10, 2020 · 1 comment
Open

spec selection does not work anymore #282

kkoo95 opened this issue Dec 10, 2020 · 1 comment

Comments

@kkoo95
Copy link

kkoo95 commented Dec 10, 2020

When using this stack of dependencies:

    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.1.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",

and this config:

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage'),
      require('@angular-devkit/build-angular/plugins/karma')
    ],
    client: {
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    coverageReporter: {
      dir: require('path').join(__dirname, '../../coverage/lib'),
      subdir: '.',
      reporters: [
        { type: 'html' },
        { type: 'text-summary' }
      ]
    },
    reporters: ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    singleRun: false,
    restartOnFileChange: true
  });
};

(both generated by a brand new Angular 11 project)

And clicking on a specific spec link in the DEBUG view (I don't really know if it's supposed to work in the regular view)
We get this error in the console (apparently not the first time we click)
:

10 12 2020 08:43:34.836:INFO [Chrome 87.0.4280.66 (Windows 10)]: Connected on socket dqHo_8kFL8ZscxeQAAAD with id manual-8346
10 12 2020 08:43:34.867:WARN [Chrome 87.0.4280.66 (Windows 10)]: Disconnected (0 times)Client disconnected from CONNECTED state (transport error)
Chrome 87.0.4280.66 (Windows 10) ERROR
  DisconnectedClient disconnected from CONNECTED state (transport error)

Chrome 87.0.4280.66 (Windows 10) ERROR
  DisconnectedClient disconnected from CONNECTED state (transport error)
Chrome 87.0.4280.66 (Windows 10): Executed 2 of 2 SUCCESS (0.092 secs / 0.038 secs)
Chrome 87.0.4280.66 (Windows 10): Executed 2 of 2 SUCCESS (0.087 secs / 0.05 secs)

And, as we can see, all specs are eventually ran instead. LOG_DEBUG isn't too much of help here.

For an easy repro, create an empty Angular 11 project, with a new library in it and run its tests:

ng new --create-application=false --skip-git
cd <projectname>
ng g lib lib
ng run lib:test

2 spec files will be available to run

@kkoo95 kkoo95 changed the title spec selection does not work spec selection does not work anymore Dec 10, 2020
@kkoo95
Copy link
Author

kkoo95 commented Dec 10, 2020

it used to work with a setup brough by angular 9:

    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~3.0.1",
    "karma-jasmine-html-reporter": "^1.4.2"

config

{
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular-devkit/build-angular/plugins/karma')
    ],
    client: {
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    coverageIstanbulReporter: {
      dir: require('path').join(__dirname, '../../coverage/lib'),
      reports: ['html', 'lcovonly', 'text-summary'],
      fixWebpackSourcePaths: true
    },
    reporters: ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    singleRun: false,
    restartOnFileChange: true
  }

repro:

cd repro-ng9
npm init && npm i @angular/cli@9
npx ng new --create-application=false --skip-git
cd <projectname>
npx ng g lib lib
npx ng run lib:test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant