Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Waza
    @waza-kaunda
    code
    {
    "type": "chrome",
    "request": "attach",
    "name": "Unit tests",
    "address": "localhost",
    "port": 9877,
    "sourceMaps": true,
    "webRoot": "${workspaceFolder}/....",
    "pathMapping": {
    "/_karmawebpack": "${workspaceFolder}/..."
    }
    },
    {
    "type": "chrome",
    "request": "launch",
    "name": "...",
    "url": "http://localhost:4200",
    "preLaunchTask": "mock:start",
    "postDebugTask": "debug:stop",
    "webRoot": "...",
    "port": 9876
    },
    baumfrosch2000
    @baumfrosch2000
    Unfortunatelly I get the same error message as before when I start the tests :-(
    Waza
    @waza-kaunda
    okay have a look at my karma.conf.js see if anything jumps out.
    code
    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-istanbul-reporter'), require('@angular-devkit/build-angular/plugins/karma'), require('karma-spec-reporter') ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { dir: require('path').join(__dirname, '../coverage'), reports: ['html', 'lcovonly'], fixWebpackSourcePaths: true }, reporters: ['progress', 'kjhtml', 'spec'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: false }); };
    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-istanbul-reporter'),
          require('@angular-devkit/build-angular/plugins/karma'),
          require('karma-spec-reporter')
        ],
        client: {
          clearContext: false // leave Jasmine Spec Runner output visible in browser
        },
        coverageIstanbulReporter: {
          dir: require('path').join(__dirname, '../coverage'),
          reports: ['html', 'lcovonly'],
          fixWebpackSourcePaths: true
        },
        reporters: ['progress', 'kjhtml', 'spec'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: true,
        browsers: ['Chrome'],
        singleRun: false
      });
    };
    baumfrosch2000
    @baumfrosch2000
    Thank you!
    Waza
    @waza-kaunda
    No problem hope you come good
    baumfrosch2000
    @baumfrosch2000
    I meant thank you for your code :-)
    Still same error message. My karma.conf.js is similar to yours.
    ... connect: ECONNREFUSED 127.0.0.1:9877
    Waza
    @waza-kaunda
    did you remove this flag flags: [ '--remote-debugging-port=9333' ]
    baumfrosch2000
    @baumfrosch2000
    Yes, I removed the complete customLaunchers-attribute
    Here is my karma.conf.js
    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-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/blackbox'),
    reports: ['html', 'lcovonly', 'text-summary'],
    fixWebpackSourcePaths: true
    },
    reporters: ['progress', 'kjhtml', 'spec'],
    // old port: 9333
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    // browsers: [
    // 'ChromeDebugging'
    // ],
    // customLaunchers: {
    // ChromeDebugging: {
    // base: 'Chrome',
    // flags: [ '--remote-debugging-port=9333' ]
    // }
    // },
    singleRun: false
    // restartOnFileChange: true,
    });
    };
    Waza
    @waza-kaunda
    other than that I'm pretty stumped I don't see what could be preventing you from connecting.
    baumfrosch2000
    @baumfrosch2000
    Yes, I am also pretty frustrated
    baumfrosch2000
    @baumfrosch2000
    Waza, we have not talked about my yesterday's question:
    An error message pops up, saying something like "Connection with runtime process not possible, timeout after 10000 ms (reason: no valid target found, which corresponds to "about: blank". Availabe pages: "http://localhost:9876/id=...". Before I start Visual Studio Code the port 9876 is empty, after starting Visual Studio Code, this port is occupied and it prevents the normal debugging
    As soon as the Angular/Karma test Explorer is loaded, node.js is loaded on port 9876 and blocks all attempts, to test the applicatation. I think this loading is the reason for the failure ... But how can I prevent it?
    Waza
    @waza-kaunda
    Yes that's because the karma test explorer needs to run the node server in the background to run the tests from the vscode I think
    Alberto Bonfiglio
    @DarthBert
    HI, i may be dumb but can't figureout why the explorer is stuck at loading (spinning icon) with no output in the console (test explorer log). It works fine if i create a new angular app (ang 9.0.7, nodejs 13.8.0 win10) bit not if it's inside a dotnet app (dotnet 3.1 ang 9.0.7, nodejs 13.8.0 win10). Any chance it's the path? The app in dotnet is in c:\repos\project\ClientApp
    Alberto Bonfiglio
    @DarthBert
    Actually to be correct project is in C:\Repo\project\application1\ClientApp, and vscode (insiders) is open at C:\Repo\project
    Alberto Bonfiglio
    @DarthBert
    If I open the project with vscode directly in clientapp it works.... Must be the path...
    Alberto Bonfiglio
    @DarthBert
    So if I open vscode at the project folder should I set the project root path as ./application1/Clientapp?
    Waza
    @waza-kaunda
    Take a look at the vs code path variables which will help you figure out your path mine generally start with {workspaceFolder}/...
    benoni marinho silva
    @benonisilva_twitter
    cant set userKarmaConfFilePath - my settings "angularKarmaTestExplorer.debugMode": true,
    "angularKarmaTestExplorer.karmaConfFilePath": "src/karma.conf.dev.js",
    Gareth
    @garethallenstringer

    Hi there, I'm trying to get started with Angular/Karma Test Explorer, and Test Explorer in general but haven't got beyond the Test tab just 'Reloading Tests'. I've tried multiple different combinations within the AKTE settings but to no avail.

    When I've tried to use the 'AKTE: Select Project' command from the Command Palette the response is 'Cannot read property 'test' of undefined.

    I am using the Remote -WSLextension, with Debugger for Chrome, Test Explorer UI and the AKTE extensions installed on WSL: Ubuntu. The Debugger for Chrome extension is enabled on WSL: Ubuntu and is disabled locally. This is a requirement for Test Explorer UI to work.

    The project I am trying to use this on has a slightly unique structure that I'll explain if relevant. The folder I have open in VS Code is the root of the angular project, where angular.json exists. This directory contains the src directory which has karma.conf.js inside.

    Does anybody have any ideas? I've read through the documentation and tried to determine what should be in the settings but haven't been able to. Many thanks

    Navneet Kumar Sharma
    @navneetsharma1988
    Hi, I could not debug the unit test...
    debug point says no source map is available for typescript..
    Please share the steps needed to run the test... and how can I load the unit test faster in Test Explorer UI?
    BePo65
    @BePo65

    I'm desperate as I cannot debug the tests in my angular project with vscode testexplorer - the test all run fine, but the debugger doesn't hit the breakpoints. No new topic, but although I tried all the 'tricks' mentioned here and in the issues of the repository, no breakpoint was hit.

    So I generated the simplest possible project with angular-cli (V9 - see BePo65/test-testexplorer-debug), but even here no breakpoint was hit.

    The problem can be seen here screenshot debugger.
    The result of the 'run test with debug' is here testexplorer log,
    the configuration of the testexplorer is as follows testexplorer config
    and the configuration of the karma adapter is here testadapter karma.

    As the problem occurs also on the minimal project, I suppose that it a consequence of missing / wrong configurations in my vscode. <but I am running out of ideas, so any help appreciated.

    BePo65
    @BePo65
    Seems that I messed up the screenshots - the images can be found in the repository in the folder 'documentation'.
    Dominic Seitz
    @dome4
    image.png
    Hey guys, im experiencing the previous announced issue with test explorer. Can somebody help please? I'm on ubuntu
    Adrian Brunton
    @ajbrun
    Hi - I'm currently having an issue with the refresh icon always being active (reloading tests). I've seen on the github issues, people have been finding errors via the test explorer logs. Could someone point me to where they're located please?
    trollshaw
    @trollshaw

    Hi, i've also running into the always spinning issue. Test Explorer log ERROR: error from ng child process: Error: spawn ng ENOENT when the extension is in debug mode.

    With a bit of fiddling with the source code i found out the extra parameters which ng test is being called with. When is run the command with the same parameters this result in an error:
    socketServer.set is not a function
    at c:\Users\«someUser».vscode\extensions\raagh.angular-karma-test-explorer-1.2.5\out\core\integration\test-explorer-custom-karma-reporter.js:78:26

    When i comment these calls out (line 78+79) test discovery seems to work again

    For what its worth, using karma version 6.0.3
    Debmallya Bhattacharya
    @batbrain9392
    Hi, hope you are doing well. I just installed the extension in an Angular 10 project (generated with the CLI). But it just rotates the "Reloading tests" icon and nothing shows up. Any help? No workspaces used, just opened the project folder in VsCode.
    trollshaw
    @trollshaw
    Being curious, Which version of karma do you have installed?
    Debmallya Bhattacharya
    @batbrain9392
    "karma": "~5.2.0",
    // Karma configuration file, see link for more information
    // https://karma-runner.github.io/1.0/config/configuration-file.html
    
    const { COVERAGE_LIMIT_STATEMENTS, COVERAGE_LIMIT_BRANCHES, COVERAGE_LIMIT_LINES, COVERAGE_LIMIT_FUNCTIONS } = process.env;
    
    const coverageThresholdLimits = {
      statements: COVERAGE_LIMIT_STATEMENTS || 0,
      branches: COVERAGE_LIMIT_BRANCHES || 0,
      lines: COVERAGE_LIMIT_LINES || 0,
      functions: COVERAGE_LIMIT_FUNCTIONS || 0,
    };
    
    module.exports = function (config) {
      config.set({
    
        plugins: [
          require('karma-jasmine'),
          require('karma-chrome-launcher'),
          require('karma-mocha-reporter'),
          require('karma-jasmine-html-reporter'),
          require('karma-coverage-istanbul-reporter'),
          require('@angular-devkit/build-angular/plugins/karma')
        ],
    
        // TRIGGER
        autoWatch: true,
        singleRun: false,
        restartOnFileChange: true,
    
        // BUILD
        frameworks: ['jasmine', '@angular-devkit/build-angular'],
        basePath: '',
    
        // RUN
        port: 9876,
        browsers: ['Chrome'],
    
        // REPORT
        colors: true,
        logLevel: config.LOG_INFO,
        reporters: ['mocha', 'kjhtml'],
        mochaReporter: { // https://www.npmjs.com/package/karma-mocha-reporter#options
          output: 'minimal',
          colors: {
            success: 'greenBright',
            info: 'yellowBright',
            warning: 'blueBright',
            error: 'redBright'
          },
        },
        client: {
          clearContext: false // leave Jasmine Spec Runner output visible in browser
        },
        coverageIstanbulReporter: {
          dir: require('path').join(__dirname, './coverage/ng8-splice-portal'),
          reports: ['html', 'lcovonly', 'text-summary', 'json-summary'],
          fixWebpackSourcePaths: true,
          thresholds: {
            global: {
              statements: coverageThresholdLimits.statements,
              branches: coverageThresholdLimits.branches,
              lines: coverageThresholdLimits.lines,
              functions: coverageThresholdLimits.functions,
            },
          },
        },
    
      });
    };
    Don Waldo
    @dgwaldo
    Having an issue getting this extension to work. I've seen a few reports in the reviews on the extensions store for VS Code that look similar to my issue.
    [5:31:11 PM] INFO: Starting Angular test environment for project: perifor
    [5:31:11 PM] INFO: Running command: "npx ng test perifor --karma-config="c:\Users\user1.vscode\extensions\raagh.angular-karma-test-explorer-1.2.8\out\config\test-explorer-karma.conf.js" --progress=false"
    with options: {cwd: c:\app\frontend, env.userKarmaConfigPath: c:\app\frontend\karma.conf.js}
    [5:31:11 PM] INFO: Listening to AngularReporter events on port 9876
    [5:31:16 PM] INFO: Waiting to connect to Karma...
    [5:31:21 PM] INFO: Waiting to connect to Karma...
    [5:31:26 PM] INFO: Waiting to connect to Karma...
    [5:31:31 PM] INFO: Waiting to connect to Karma...
    [5:31:36 PM] INFO: Waiting to connect to Karma...
    Anyone else experiencing this...
    mittulmandhan
    @mittulmandhan
    while running ng test command I get this error(No solution found online):
    ERROR [config]: Error in config file! Error: Cannot find module 'karma-jasmine' Require stack: - E:\2021\vitrivr-ng\karma.conf.js - E:\2021\vitrivr-ng\node_modules\karma\lib\config.js - E:\2021\vitrivr-ng\node_modules\karma\lib\server.js - E:\2021\vitrivr-ng\node_modules\karma\lib\index.js - E:\2021\vitrivr-ng\node_modules\@angular-devkit\build-angular\src\karma\index.js - E:\2021\vitrivr-ng\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js - E:\2021\vitrivr-ng\node_modules\@angular-devkit\architect\node\index.js - E:\2021\vitrivr-ng\node_modules\@angular\cli\models\architect-command.js - E:\2021\vitrivr-ng\node_modules\@angular\cli\commands\test-impl.js - E:\2021\vitrivr-ng\node_modules\@angular-devkit\schematics\tools\export-ref.js - E:\2021\vitrivr-ng\node_modules\@angular-devkit\schematics\tools\index.js - E:\2021\vitrivr-ng\node_modules\@angular\cli\utilities\json-schema.js - E:\2021\vitrivr-ng\node_modules\@angular\cli\models\command-runner.js - E:\2021\vitrivr-ng\node_modules\@angular\cli\lib\cli\index.js - C:\Users\lenvo\AppData\Roaming\npm\node_modules\@angular\cli\lib\init.js - C:\Users\lenvo\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at module.exports (E:\2021\vitrivr-ng\karma.conf.js:9:13) at Object.parseConfig (E:\2021\vitrivr-ng\node_modules\karma\lib\config.js:468:26) at new Server (E:\2021\vitrivr-ng\node_modules\karma\lib\server.js:81:22) at Observable._subscribe (E:\2021\vitrivr-ng\node_modules\@angular-devkit\build-angular\src\karma\index.js:105:29) at Observable._trySubscribe (E:\2021\vitrivr-ng\node_modules\@angular-devkit\build-angular\node_modules\rxjs\internal\Observable.js:44:25) at Observable.subscribe (E:\2021\vitrivr-ng\node_modules\@angular-devkit\build-angular\node_modules\rxjs\internal\Observable.js:30:22) at Object.innerSubscribe (E:\2021\vitrivr-ng\node_modules\@angular-devkit\build-angular\node_modules\rxjs\internal\innerSubscribe.js:102:23) at SwitchMapSubscriber._innerSub (E:\2021\vitrivr-ng\node_modules\@angular-devkit\build-angular\node_modules\rxjs\internal\operators\switchMap.js:63:51) at SwitchMapSubscriber._next (E:\2021\vitrivr-ng\node_modules\@angular-devkit\build-angular\node_modules\rxjs\internal\operators\switchMap.js:53:14) at SwitchMapSubscriber.Subscriber.next (E:\2021\vitrivr-ng\node_modules\@angular-devkit\build-angular\node_modules\rxjs\internal\Subscriber.js:66:18) at E:\2021\vitrivr-ng\node_modules\@angular-devkit\build-angular\node_modules\rxjs\internal\util\subscribeToPromise.js:7:24 { code: 'MODULE_NOT_FOUND', requireStack: [ 'E:\\2021\\vitrivr-ng\\karma.conf.js', 'E:\\2021\\vitrivr-ng\\node_modules\\karma\\lib\\config.js', 'E:\\2021\\vitrivr-ng\\node_modules\\karma\\lib\\server.js', 'E:\\2021\\vitrivr-ng\\node_modules\\karma\\lib\\index.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular-devkit\\build-angular\\src\\karma\\index.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular-devkit\\architect\\node\\node-modules-architect-host.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular-devkit\\architect\\node\\index.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular\\cli\\models\\architect-command.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular\\cli\\commands\\test-impl.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular-devkit\\schematics\\tools\\export-ref.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular-devkit\\schematics\\tools\\index.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular\\cli\\utilities\\json-schema.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular\\cli\\models\\command-runner.js', 'E:\\2021\\vitrivr-ng\\node_modules\\@angular\\cli\\lib\\cli\\index.js',
    Mustafa
    @moohkooh
    Hi. I tried also to get everything run. My tests are listet in the test-explorer i also could run the test but it will not reflected that are successful or not and im not able to debug. Do you have any hint for me?
    sandesh66
    @sandesh66
    Hi,
    In my angular 9 project not able to get list of unit test, It shows loading icon only, And its empty. Could tyou plase give me some suggetion to resolve this issue
    image.png