No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
TsJasmineVs2015
.gitignore
LICENSE
README.md

README.md

TypeScript with Jasmine in Visual Studio 2015

Setting up a TypeScript project and Jasmine tests in Visual Studio 2015 Based on: http://kearon.blogspot.sk/2014/08/testing-typescript-with-jasmine-in.html

  1. Create a new TypeScript project in VS 2015.
  • Remove the index.html, app.css and app.js files.
  1. Add the ASP.NET MVC NuGet package.
  1. Add greeter.ts file.

    class Greeter {
        constructor(public message: string) {
        }
    
        greet(): string {
            return "Hello " + this.message;
        }
    }
  2. Install the JasmineTest NuGet package.

    install-package JasmineTest
    
  3. Add jasmine typings.

    Install-Package jasmine.typescript.DefinitelyTyped
    
  4. Add greeter.spec.ts file.

    /// <reference path="greeter.ts"/>
    /// <reference path="Scripts/typings/jasmine/jasmine.d.ts" />
    
    describe("Greeter", () => {
    
        describe("greet", () => {
    
            it("returns Hello World", () => {
    
                // Arrange
                var greeter = new Greeter("World");
    
                // Act
                var result = greeter.greet();
    
                // Assert
                expect(result).toEqual("Hello World");
            });
        });
    });