Skip to content

Error running ng test while having an it call without the second parameter #4132

Closed
@yzhan94

Description

@yzhan94

OS?

Ubuntu 16.04 64 bits

Versions.

angular-cli: 1.0.0-beta.24
node: 4.4.7
os: linux x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/compiler-cli: 2.4.3

Repro steps.

Add an it call to the default app.component.spec.ts file leaving the second parameter empty.
E.g.:

// src/app/app.component.spec.ts
// ...
describe('AppComponent', () => {
  // ...
  it('should pass');
});

The log given by the failure.

Chromium 55.0.2883 (Ubuntu 0.0.0) AppComponent encountered a declaration exception FAILED
	TypeError: Cannot read property 'length' of undefined
	    at wrapTestInZone (webpack:///~/zone.js/dist/jasmine-patch.js:101:0 <- src/test.ts:51429:25)
	    at Env.jasmineEnv.(anonymous function) [as it] (webpack:///~/zone.js/dist/jasmine-patch.js:72:0 <- src/test.ts:51400:28)
	    at Suite.<anonymous> (webpack:///src/app/app.component.spec.ts:35:2 <- src/test.ts:67127:5)
	    at ZoneDelegate.invoke (webpack:///~/zone.js/dist/zone.js:242:0 <- src/test.ts:70686:26)
	    at Zone.run (webpack:///~/zone.js/dist/zone.js:113:0 <- src/test.ts:70557:43)
	    at Suite.<anonymous> (webpack:///~/zone.js/dist/jasmine-patch.js:89:0 <- src/test.ts:51417:29)
	    at Env.jasmineEnv.(anonymous function) [as describe] (webpack:///~/zone.js/dist/jasmine-patch.js:66:0 <- src/test.ts:51394:38)
	    at Object.<anonymous> (webpack:///src/app/app.component.spec.ts:6:0 <- src/test.ts:67102:1)
	    at __webpack_require__ (webpack:/webpack/bootstrap%205020e831b3ddab763f2e:19:0 <- src/test.ts:20:30)
	    at webpackContext (webpack:/src%20/.spec/.ts$:6:0 <- src/test.ts:51825:9)
	    at Array.map (native)

Mention any other details that might be useful.

I wanted to leave the test implementation for later, and followed this answer on stackoverflow.
It might not be an unwanted behavior, but I thought it would behave as a pending test and fail it as such, and the stacktrace barely indicates where the problem is.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions