1

I'm using Angular 7. I wrote a real simple test class, src/app/pastebin.ts,

export class Pastebin {
    id: number;
    title: string;
    language: string;
    paste: string;

    constructor(values: Object = {}) {
        Object.assign(this, values);
  }
}

export const Languages = ["Ruby","Java", "JavaScript", "C", "Cpp"];

and then a real simple Jasmine spec, src/app/pastebin.spec.ts, to test it,

/* pastebin.spec.ts */

//import the Pastebin class
import { Pastebin } from './pastebin';

describe('Pastebin', () => {
    it('should create an instance of Pastebin',() => {
        expect(new Pastebin()).toBeTruthy();
    });

})

but when I go to run my tests, I get some errors that look like anything related to what I've done ...

localhost:Pastebin davea$ ng test
 10% building modules 1/1 modules 0 active30 08 2019 15:53:13.954:WARN [karma]: No captured browser, open http://localhost:9876/
30 08 2019 15:53:13.960:INFO [karma]: Karma v2.0.5 server started at http://0.0.0.0:9876/
30 08 2019 15:53:13.960:INFO [launcher]: Launching browsers Chrome, ChromeNoSandboxHeadless with unlimited concurrency
30 08 2019 15:53:13.964:INFO [launcher]: Starting browser Chrome
30 08 2019 15:53:13.974:INFO [launcher]: Starting browser Chrome
[./src/test.ts] ./src/test.ts 0 bytes {main} [built]                               
   [0] multi ./src/polyfills.ts 28 bytes {polyfills} [built]
[./src/polyfills.ts] ./src/polyfills.ts 0 bytes {polyfills} [built]

ERROR in node_modules/@types/jasmine/index.d.ts(142,47): error TS1005: ';' expected.
node_modules/@types/jasmine/index.d.ts(142,90): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(142,104): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(142,112): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(142,113): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(142,121): error TS1005: ')' expected.
node_modules/@types/jasmine/index.d.ts(142,147): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(142,162): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(142,163): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(142,164): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(142,165): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(142,179): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(142,183): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(142,208): error TS1005: '{' expected.
node_modules/@types/jasmine/index.d.ts(142,217): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(142,222): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(142,227): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(142,228): error TS1109: Expression expected.
node_modules/@types/jasmine/index.d.ts(142,230): error TS1005: ')' expected.
node_modules/@types/jasmine/index.d.ts(635,30): error TS1005: ';' expected.
node_modules/@types/jasmine/index.d.ts(720,1): error TS1128: Declaration or statement expected.

Anyone know how I can approach this problem?

Edit: In response to the answer given, this is the new output ...

localhost:Pastebin davea$ ng test
 10% building modules 1/1 modules 0 active01 09 2019 11:34:18.591:WARN [karma]: No captured browser, open http://localhost:9876/
01 09 2019 11:34:18.616:INFO [karma-server]: Karma v4.3.0 server started at http://0.0.0.0:9876/
01 09 2019 11:34:18.617:INFO [launcher]: Launching browsers Chrome, ChromeNoSandboxHeadless with concurrency unlimited
01 09 2019 11:34:18.622:INFO [launcher]: Starting browser Chrome
01 09 2019 11:34:18.797:INFO [launcher]: Starting browser Chrome
[./src/test.ts] ./src/test.ts 0 bytes {main} [built]                               
   [0] multi ./src/polyfills.ts 28 bytes {polyfills} [built]
[./src/polyfills.ts] ./src/polyfills.ts 0 bytes {polyfills} [built]

ERROR in node_modules/@types/jasmine/index.d.ts(191,11): error TS1005: ';' expected.
node_modules/@types/jasmine/index.d.ts(192,36): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(192,50): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(192,58): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(192,59): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(192,67): error TS1005: ')' expected.
node_modules/@types/jasmine/index.d.ts(193,37): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(193,52): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(193,53): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(193,54): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(193,55): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(193,69): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(193,73): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(193,98): error TS1005: '{' expected.
node_modules/@types/jasmine/index.d.ts(193,107): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(193,112): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(193,117): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(193,118): error TS1109: Expression expected.
node_modules/@types/jasmine/index.d.ts(193,120): error TS1005: ')' expected.
node_modules/@types/jasmine/index.d.ts(748,30): error TS1005: ';' expected.
node_modules/@types/jasmine/index.d.ts(854,1): error TS1128: Declaration or statement expected.

Edit 2:After applying the suggestion from the answer I got the new error

davea$ ng test
 10% building modules 1/1 modules 0 active02 09 2019 10:20:52.750:WARN [karma]: No captured browser, open http://localhost:9876/
02 09 2019 10:20:52.776:INFO [karma-server]: Karma v4.3.0 server started at http://0.0.0.0:9876/
02 09 2019 10:20:52.776:INFO [launcher]: Launching browsers Chrome, ChromeNoSandboxHeadless with concurrency unlimited
02 09 2019 10:20:52.780:INFO [launcher]: Starting browser Chrome
02 09 2019 10:20:52.787:INFO [launcher]: Starting browser Chrome
02 09 2019 10:20:56.030:WARN [karma]: No captured browser, open http://localhost:9876/  
02 09 2019 10:20:56.216:INFO [HeadlessChrome 76.0.3809 (Mac OS X 10.13.6)]: Connected on socket lcRdfhRmFhHi04mTAAAA with id 64655559
02 09 2019 10:20:56.232:INFO [Chrome 76.0.3809 (Mac OS X 10.13.6)]: Connected on socket IL97l6a-00J6s9H9AAAB with id 6205557
Browser {
  id: '6205557',
  fullName: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) ' +
    'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 ' +
    'Safari/537.36',
  name: 'Chrome 76.0.3809 (Mac OS X 10.13.6)',
  lastResult: [BrowserResult],
  disconnectsCount: 0,
  activeSockets: [Array],
  noActivityTimeout: 30000,
  collection: [BrowserCollection],
  emitter: [Server],
  socket: [Socket],
  timer: [Object],
  disconnectDelay: 2000,
  log: [Logger],
  noActivityTimeoutId: Timeout {
    _idleTimeout: 30000,
    _idlePrev: [Timeout],
    _idleNext: [Timeout],
    _idleStart: 10322,
    _onTimeout: [Function],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: true,
    [Symbol(asyncId)]: 19087,
    [Symbol(triggerId)]: 19085
  },
  pendingDisconnect: null,
  state: 'EXECUTING'
} ERROR
  An error was thrown in afterAll
  TypeError: env.catchExceptions is not a function
      at node_modules/karma-jasmine-html-reporter/src/lib/adapter.js:24:9
      at node_modules/karma-jasmine-html-reporter/src/lib/adapter.js:58:3
Chrome 76.0.3809 (Mac OS X 10.13.6): Executed 4 of 4 ERROR (0 secs / 0.154 secs)
HeadlessChrome 76.0.3809 (Mac OS X 10.13.6): Executed 3 of 4 SUCCESS (0 secs / 0.132 secs)
Browser {
  id: '6205557',
  fullName: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) ' +
    'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 ' +
    'Safari/537.36',
  name: 'Chrome 76.0.3809 (Mac OS X 10.13.6)',
  lastResult: [BrowserResult],
  disconnectsCount: 0,
  activeSockets: [Array],
  noActivityTimeout: 30000,
  collection: [BrowserCollection],
  emitter: [Server],
  socket: [Socket],
  timer: [Object],
  disconnectDelay: 2000,
  log: [Logger],
  noActivityTimeoutId: Timeout {
    _idleTimeout: 30000,
    _idlePrev: [Timeout],
    _idleNext: [Timeout],
    _idleStart: 10322,
    _onTimeout: [Function],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: true,
    [Symbol(asyncId)]: 19087,
    [Symbol(triggerId)]: 19085
  },
  pendingDisconnect: null,
  state: 'EXECUTING'
} ERROR
  An error was thrown in afterAll
  TypeError: env.catchExceptions is not a function

Edit 3 Here's the package.json ...

localhost:Pastebin davea$ cat package.json 
{
  "name": "pastebin",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.4",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "^2.8.8",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "^2.99.1",
    "jasmine-spec-reporter": "^3.2.0",
    "karma": "^4.3.0",
    "karma-chrome-launcher": "^3.1.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "^2.0.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "^2.7.2"
  }
}

and here's the error I get upon running the tests ...

localhost:Pastebin davea$ ng test
 10% building modules 1/1 modules 0 active07 09 2019 12:27:20.412:WARN [karma]: No captured browser, open http://localhost:9876/
07 09 2019 12:27:20.429:INFO [karma-server]: Karma v4.3.0 server started at http://0.0.0.0:9876/
07 09 2019 12:27:20.429:INFO [launcher]: Launching browsers Chrome, ChromeNoSandboxHeadless with concurrency unlimited
07 09 2019 12:27:20.433:INFO [launcher]: Starting browser Chrome
07 09 2019 12:27:20.441:INFO [launcher]: Starting browser Chrome
07 09 2019 12:27:23.398:WARN [karma]: No captured browser, open http://localhost:9876/  
07 09 2019 12:27:23.600:INFO [HeadlessChrome 76.0.3809 (Mac OS X 10.13.6)]: Connected on socket BQzsVF64PPIY9jUsAAAA with id 32854347
07 09 2019 12:27:23.624:INFO [Chrome 76.0.3809 (Mac OS X 10.13.6)]: Connected on socket edznAyypyhtvngwrAAAB with id 87775700
HeadlessChrome 76.0.3809 (Mac OS X 10.13.6) ERROR
  An error was thrown in afterAll
  TypeError: env.catchExceptions is not a function
      at node_modules/karma-jasmine-html-reporter/src/lib/adapter.js:24:9
      at node_modules/karma-jasmine-html-reporter/src/lib/adapter.js:58:3
HeadlessChrome 76.0.3809 (Mac OS X 10.13.6): Executed 4 of 4 ERROR (0 secs / 0.144 secs)
Chrome 76.0.3809 (Mac OS X 10.13.6): Executed 2 of 4 SUCCESS (0 secs / 0.117 secs)
HeadlessChrome 76.0.3809 (Mac OS X 10.13.6) ERROR
  An error was thrown in afterAll
  TypeError: env.catchExceptions is not a function
Chrome 76.0.3809 (Mac OS X 10.13.6) ERROR
  An error was thrown in afterAll
  TypeError: env.catchExceptions is not a function
      at node_modules/karma-jasmine-html-reporter/src/lib/adapter.js:24:9
      at node_modules/karma-jasmine-html-reporter/src/lib/adapter.js:58:3
HeadlessChrome 76.0.3809 (Mac OS X 10.13.6): Executed 4 of 4 ERROR (0.146 secs / 0.144 secs)
Chrome 76.0.3809 (Mac OS X 10.13.6): Executed 4 of 4 ERROR (0 secs / 0.142 secs)
Chrome 76.0.3809 (Mac OS X 10.13.6) ERROR
  An error was thrown in afterAll
  TypeError: env.catchExceptions is not a function
HeadlessChrome 76.0.3809 (Mac OS X 10.13.6): Executed 4 of 4 ERROR (0.146 secs / 0.144 secs)
Chrome 76.0.3809 (Mac OS X 10.13.6): Executed 4 of 4 ERROR (0.157 secs / 0.142 secs)
Dave
  • 15,639
  • 133
  • 442
  • 830
  • Unrelated to your question, but you should read https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#general-types – Ingo Bürk Aug 30 '19 at 21:09
  • I tried running your code on my angular project and it was working fine. The problem seems to be something else. Can you do `xdescribe` and then `fdescribe` and let us know any difference in output – Shashank Vivek Aug 31 '19 at 03:42
  • 1
    Maybe you have a broken installation of you node modules. Can you trying re-installing them? – lealceldeiro Sep 01 '19 at 16:40
  • @ShashankVivek, I tried running "xdescribe" but got the error "-bash: xdescribe: command not found". – Dave Sep 01 '19 at 16:43
  • @lealceldeiro, Are the re-install commands you suggest different than what's given in the answer? Those are the ones I just ran and got the error posted in the quesiton edit. – Dave Sep 01 '19 at 16:58
  • @Dave Can show us your `package.json` ? – Hsuan Lee Sep 06 '19 at 02:18

3 Answers3

5

I've seen a very similar issue to this when running typescript @ 2.7.2 and @types/jasmine greater than 2.8.8 or jasmine >= 3.0.

Known safe working version for me is

"dependencies": {
    "@angular/animations": "7.2.0",
    "@angular/common": "7.2.0",
    "@angular/compiler": "7.2.0",
    "@angular/core": "7.2.0",
    "@angular/forms": "7.2.0",
    "@angular/platform-browser": "7.2.0",
    "@angular/platform-browser-dynamic": "7.2.0",
    "@angular/router": "7.2.0",
    "core-js": "2.5.4",
    "rxjs": "6.3.3",
    "tslib": "1.9.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.13.0",
    "@angular/cli": "7.3.8",
    "@angular/compiler-cli": "7.2.0",
    "@angular/language-service": "7.2.0",
    "@types/node": "8.9.4",
    "@types/jasmine": "2.8.8",
    "@types/jasminewd2": "2.0.3",
    "codelyzer": "5.1.0",
    "jasmine-core": "2.99.1",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "4.1.0",
    "karma-chrome-launcher": "2.2.0",
    "karma-coverage-istanbul-reporter": "2.0.5",
    "karma-jasmine": "2.0.1",
    "karma-jasmine-html-reporter": "1.4.2",
    "protractor": "5.4.2",
    "ts-node": "7.0.0",
    "tslint": "5.11.0",
    "typescript": "3.2.2"
  }

If that isn't it please post your package.json. Some of the updated libraries require typescript 3.0, and if you don't have that you have to point to older versions.

Also I see that https://github.com/dfederm/karma-jasmine-html-reporter says For Jasmine < 3.0.0, use version 0.2.2, so you may also want to check that you have

"karma-jasmine-html-reporter":"0.2.2"
Wesley Trantham
  • 1,154
  • 6
  • 12
  • Hi, I updated the versions to what you suggested (included my package.json in edit-3 to my question). I also included the error I get as a result -- "TypeError: env.catchExceptions is not a function" – Dave Sep 07 '19 at 17:30
  • Huh, that's interesting, as package.json indicates you're using Angular 5 when you say you're on Angular 7. I'm updating my answer to have the full dependency list for my angular 7 app that I know works. It has a higher version of typescript as well, which I think is what is going to fix what you're seeing. – Wesley Trantham Sep 07 '19 at 17:53
  • Also please note that I don't use `~` or `^` as these dependencies can be strange. I like exact versions for consistency. – Wesley Trantham Sep 07 '19 at 17:55
  • Thanks. I replaced my package.json's "dependencies" and "devDependencies" with what you have. Do I need to do something to install those before I run "ng test"? I ask because after I replaced those in package.json and ran "ng test" I still got these "HeadlessChrome 76.0.3809 (Mac OS X 10.13.6) ERROR, An error was thrown in afterAll, TypeError: env.catchExceptions is not a function" errors. – Dave Sep 08 '19 at 20:54
  • Oh yes, after you set those up just run `npm i` or `npm install`. Sometimes you need to delete package-lock.json first – Wesley Trantham Sep 09 '19 at 01:02
  • I should have mentioned how I approached fixing this when I encountered this a few months ago. I was upgrading jasmine and found the latest version gave me the error you originally saw. So then I started downgrading by typing in version numbers in package.json and running `npm i`. It took several tries, but I found the newest version of jasmine that I could use with the version of typescript I was locked into at the time as we were only on Angular 6. @Dave – Wesley Trantham Sep 09 '19 at 01:07
2

It seems like you are running Karma v2.0.5 which is a really outdated version of Karma.

30 08 2019 15:53:13.960:INFO [karma]: Karma v2.0.5 server started at http://0.0.0.0:9876/

If my memory serves me right, I had encountered this error before because I was running an outdated Karma with a more updated typescript or was it the other way around.

Anyway, the latest Karma test runner is V4.3.0.

You can upgrade your Karma and Jasmine by executing these commands:


npm install karma@latest --save-dev
npm install karma-jasmine@latest karma-chrome-launcher@latest jasmine-core@latest --save-dev
npm install @types/jasmine@latest --save-dev

If you have installed additional karma plugins, you'd probably want to update them too. Take a look at your package.json. For e.g. , you might have karma-firefox-launcher instead of chrome's version.


I did a simple search on my browser history and found this github issue: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30310

This issue highlighted how they solved the problem by downgrading/upgrading their typescript to the support jasmine/karma version.

With trial-and-error and probably some researching, you'd most probably find a suitable combination of karma, jasmine and typescript versions that are compatible with each other in Angular 7.

However, I'd suggest that you simply upgrade your @angular/cli from Angular 7 to Angular 8 and update all of your karma and jasmine packages.

Angular 8 contains many breaking changes that resulted in many Angular 3rd party libs in updating all their libraries. Therefore, if you were to do a npm i some-lib in the future, it may not work with your Angular 7 project. And you'd have to find the last working version that works well with Angular 7. Upgrading to Angular 8 will save you a lot of these "downgrading" trouble. The latest karma and jasmine packages work with Angular 8 and it's much easier for you to just upgrade everything to the latest working versions.

Official Angular Update Guide

terahertz
  • 2,915
  • 1
  • 21
  • 33
  • Hi @Riv, I ran the commands and added the output as an edit to my question. Now you can see I have karma 4.3.0 but still get the errors above. – Dave Sep 01 '19 at 16:45
  • I've edited my answer with a github issue that's related to that error code I've found in my search history. I hope it sets you in the right direction though... – terahertz Sep 01 '19 at 17:33
  • Thx. Having a bit of trouble with the solution, "npm install typescript/2.8.4 --save-dev" recommended in the link (getting The authenticity of host 'github.com (192.30.253.113)' can't be established.0d71) but it's a good starting point. – Dave Sep 02 '19 at 03:32
  • Do note that github issue is almost a year old. And Angular 7 (which you mentioned is the version you are using in your question) supports typescript 3.1, I am not sure about typescript 2.8.4. That's why I suggested that you simply upgrade everything to the latest version =) – terahertz Sep 02 '19 at 03:37
  • Hey @Dave, looks like you had started a bounty =0... did you update to Angular 8 and it's still not resolved for you? Also, have a look at [this](http://dailydevfixes.blogspot.com/2018/11/angular-4-sudden-typesjasmine-error-at.html), maybe it'd help if you just remove the preceding symbols before jasmine packages? – terahertz Sep 03 '19 at 16:40
  • Unfortunately, in my current situation, upgrading to Angular 8 is not an option. I would like to see if there is a solution for Angular 7. Thanks for all your suggestions, though. – Dave Sep 03 '19 at 20:20
  • icic. I just saw your edit, seems like you managed to get karma running. But your jasmine version is probably too new/old, that's why a function couldn't be found. Check out this [github issue](https://github.com/ionic-team/ionic-unit-testing-example/issues/79#issuecomment-460706041), he managed to fix `TypeError: env.catchExceptions is not a function` for Angular 7 with a combination of lower versions of karma and jasmine. Anyway, if it doesn't help you to solve the issue, may I suggest that you edit in your package.json? – terahertz Sep 04 '19 at 02:46
  • i had the same issue during an project-update from angular 7 to 8. In my case i need to update karma-jasmine-html-reporter to the latest version (0.2.2 => 1.4.2). Maybe in your case you need to find a matching version. – deelde Sep 04 '19 at 12:10
0

It does not look like you wrap your test around a beforeEach to set up the Angular Testing Module. Can you try the code below:

    describe('MyComponent', () => {
      beforeEach(async(() => {
        TestBed.configureTestingModule({
          declarations: [ 
            // All the components referenced in the test
          ],    
          providers: [
            // All injected services
          ]
        })
        .compileComponents();
      }));


    it('should create an instance of Pastebin',() => {
      expect(new Pastebin()).toBeTruthy();
    });

  })
Paul
  • 460
  • 2
  • 7
  • Hi @Paul, I get two errors when I run your code. They are "ERROR in src/app/pastebin.spec.ts(7,14): error TS2304: Cannot find name 'async'. src/app/pastebin.spec.ts(8,5): error TS2304: Cannot find name 'TestBed'" – Dave Sep 05 '19 at 15:06
  • You can import this from @angular/core/testing. Hope this helps! – Paul Sep 06 '19 at 16:26
  • That solved the TestBed error but what about the async error? Still get the error, "error TS2304: Cannot find name 'async'." – Dave Sep 07 '19 at 17:34
  • Did you also import async from @angular/core/testing? – Paul Sep 07 '19 at 18:15
  • That solved the compilation error, but now the error that occurs when running the test itself is, "HeadlessChrome 76.0.3809 (Mac OS X 10.13.6) ERROR, An error was thrown in afterAll, TypeError: env.catchExceptions is not a function" – Dave Sep 08 '19 at 20:48
  • See if the link https://stackoverflow.com/questions/51543241/angular-6-unit-tests-an-error-was-thrown-in-afterall-nreferenceerror-cant-fin helps.... I think you can install karma-spec-reporter and add it to the karma.conf.js configuration to get better messages. – Paul Sep 09 '19 at 21:51