Semantic errors typescript NgMatchers for Angular 2

I am trying to set up an Angular 2 project with Gulp and jasmine (after seeing this example), but somehow I keep receiving these semantic errors when compiling my typescript:

matchers.d.ts(4,37): error TS2503: Cannot find namespace 'jasmine'.

process/typescript/app-component.spec.ts(8,22): error TS2339: Property 'toEqual' does not exist on type 'NgMatchers'.

For the following testcase:

import {it, describe, expect, beforeEach, inject} from 'angular2/testing';
import {AppComponent} from "./app.component";

describe('App component test', () => {
    let component: AppComponent;

    it('Value of testvar should be test', () => {
        expect(true).toEqual(true);
    });
});

I have no idea where this is going wrong, especially since I am loading the jasmine typings…
typings.json

{
    "ambientDependencies": {
        "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
        "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
    }
}

gulpfile.js

var gulp = require('gulp'),
    webserver = require('gulp-webserver'),
    typescript = require('gulp-typescript'),
    sourcemaps = require('gulp-sourcemaps'),
    tscConfig = require('./tsconfig.json');

gulp.task('typescript', function () {
  return gulp
    .src(tsSrc + '**/*.ts')
    .pipe(sourcemaps.init())
    .pipe(typescript(tscConfig.compilerOptions))
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest(appSrc + 'js/'));
});

tsconfig.json

{
    "compilerOptions": {
        "target": "es5",
        "module": "system",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": true
    },
    "exclude": [
        "node_modules"
    ]
}

Does anybody have an idea what is going wrong? As far as I know I am loading all the necessary packages.

package.json

   "dependencies": {
        "angular2": "2.0.0-beta.15",
        "systemjs": "^0.19.24",
        "es6-promise": "^3.0.2",
        "es6-shim": "^0.35.0",
        "reflect-metadata": "0.1.2",
        "rxjs": "5.0.0-beta.2",
        "zone.js": "0.6.11"
    },
  "devDependencies": {
    "gulp": "^3.9.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-typescript": "^2.13.0",
    "gulp-webserver": "^0.9.1",
    "http-server": "",
    "jasmine-core": "^2.4.1",
    "karma": "^0.13.22",
    "karma-chrome-launcher": "^0.2.3",
    "karma-coverage": "^0.5.5",
    "karma-jasmine": "^0.3.8",
    "remap-istanbul": "^0.6.3",
    "typescript": "^1.8.10",
    "typings": "^0.6.8"
  }

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

I quess the compiler needs the declaration file like this

/// <reference path="../node_modules/angular2/typings/browser.d.ts" />
/// <reference path="../typings/main/ambient/jasmine/index.d.ts" />
import {it, describe, expect, beforeEach, inject} from 'angular2/testing';
import {AppComponent} from "./app.component";

describe('App component test', () => {
    let component: AppComponent;

    it('Value of testvar should be test', () => {
        expect(true).toEqual(true);
    });
});