Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

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");
            });
        });
    });

About

No description, website, or topics provided.

Resources

License

Releases

No releases published

Packages

No packages published

Languages