'Tools/jasmine'에 해당되는 글 3건

[Jasmine] Spies

Tools/jasmine 2016. 7. 29. 13:42
donaricano-btn

Spies

- We want to be able to check if functions have been called so We use it Spies

- It lets you spy on pieces of your program


1. spyOn()

1_1 src


1_2. spec

 

- This will spy on this fake person's sayHello() method.

'Tools > jasmine' 카테고리의 다른 글

[Jasmine] Matcher  (0) 2016.07.29
[Jasmine] Jasmine  (0) 2016.07.21
블로그 이미지

리딩리드

,

[Jasmine] Matcher

Tools/jasmine 2016. 7. 29. 11:46
donaricano-btn

Matcher

- There are more matchers and I can make my own matchers


1. MoreMatchers

1) toEqual()

- It compare both objects If it is equal or not

2) toMatch()

    - toMatch() matcher is for regular expression


3) toBeDefine()

- The toBeDefined() matcher compares againt 'undefined'

 

4) toContain()

- The toContain() matcher is for finding an item in an Array

 

'Tools > jasmine' 카테고리의 다른 글

[Jasmine] Spies  (0) 2016.07.29
[Jasmine] Jasmine  (0) 2016.07.21
블로그 이미지

리딩리드

,

[Jasmine] Jasmine

Tools/jasmine 2016. 7. 21. 14:18
donaricano-btn

Jasmine


1. What is the Jasmine?

- Jasmine is a behavior-driven testing framework for Javascript

- Jasmine is an automated testing framework 


2. How to get

- There are two ways to get a jasmine

1) download zip 

- https://github.com/jasmine/jasmine/releases

2)  npm

2_0. install

# Local installation:

npm install --save-dev jasmine

# Global installation

npm install -g jasmine

2_1. Init

- jasmine init

- jasmine examples

2_2. Usage

- jasmine


3. Usage

3_0. Src


3_1. Spec

 1) suite 

- describe("Hello.....) What we call a suite

- This is basically a component of your application

- This suite is called "Hello World"

2) spec

- it()

- This is called a spec

- For each suite, you can have a bajillion specs for the bajillion tests you want to do

3) matcher

- We're testing if helloworld() does equal "Hello world".

- This check is called a matcher

- I can also make my own matcher


3_2. SpecRunner

1) SpecRunner.html

2) view



'Tools > jasmine' 카테고리의 다른 글

[Jasmine] Spies  (0) 2016.07.29
[Jasmine] Matcher  (0) 2016.07.29
블로그 이미지

리딩리드

,