»

Rquire.js with Jasmine 2

Coding — Tags: , , , — Posted by Starck on February 21, 2014

Require


Project structure

Project/
│
├── css/
│   └── jasmine.css
├── js/
│   ├── require.js
│   ├── main.js
│   ├── models/
│   │   ├── player.js
│   │   └── song.js
│   └── test
│       ├── spec/
│       │   └── playerSpec.js
│       ├── jasmine.js
│       ├── jasmine-html.js
│       └── boot.js
└── index.html

index.html

main.js

js/models/player.js

js/models/song.js

js/test/spec/playerSpec.js

method

  • toBe()
  • toEqual()
  • .not
  • toMatch(/Regex/)
  • toBeDefined()
  • toBeUndefined()
  • toBeNull()
  • toBeTruthy()
  • toBeFalsy()
  • toContain()
  • toBeLessThan()
  • toBeGreaterThan()
  • toBeCloseTo(e, number)
  • toThrow()
  • spyOn(obj, ‘method’)
    • toHaveBeenCalled()
    • toHaveBeenCalledWith(args…)
    • mostRecentCall

A Solution for Cross Browser Testing

Design — Tags: , — Posted by Starck on August 25, 2013


Cross-browser-testing


It’s always a disturbing issue for testing IE browser between different versions, but I found a good solution from Microsoft:

Download IE VMs

(c) 2024 Starck Lin | powered by WordPress