Slide 1

Slide 1 text

Test like a boss with typescript @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 2

Slide 2 text

Me myself and I - Front end developer @S_A_N_T_E_C_H - In love with unit tests since 2013 - In love with TypeScript since 2014 - Paris TypeScript co Organizer @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 3

Slide 3 text

What are we going to talk about ? How to test your assets Back end with mocha / supertest Front end with karma / jasmine Front end with protractor Everything in TypeScript @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 4

Slide 4 text

What are we not going to talk about ? mocha / karma / jasmine … internals @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 5

Slide 5 text

What are we not going to talk about ? TDD / BDD / DDD Unit tests / integration tests / e2e tests @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 6

Slide 6 text

Backend : Stack Supertest NYC @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 7

Slide 7 text

Backend : Everything starts with @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 8

Slide 8 text

Backend : Config ts-node tsconfig.json @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 9

Slide 9 text

Backend : Config NYC Package.json More here @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 10

Slide 10 text

Backend : First spec @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 11

Slide 11 text

@paulsouche / https://github.com/paulsouche / [email protected] Demo ? #typescriptertalk @S_A_N_T_E_C_H

Slide 12

Slide 12 text

Backend : Yeah but… What if ? @paulsouche / https://github.com/paulsouche / [email protected] I need to stub some methods ? I’ve real repositories ? I’m using HAPI ? Use sinon.js Use proxyquire supertest compatible but other solutions exist #typescriptertalk @S_A_N_T_E_C_H

Slide 13

Slide 13 text

Frontend : Stack @paulsouche / https://github.com/paulsouche / [email protected] Please insert your favourite build engine ... #typescriptertalk @S_A_N_T_E_C_H

Slide 14

Slide 14 text

Frontend : OK karma what is a preprocessor ? @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 15

Slide 15 text

Frontend : Did you say bundle ? @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 16

Slide 16 text

@paulsouche / https://github.com/paulsouche / [email protected] Demo ? #typescriptertalk @S_A_N_T_E_C_H

Slide 17

Slide 17 text

Frontend : Yeah but… It’s slow right ? @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 18

Slide 18 text

Frontend : Alternatives @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H Webpack dll Faster dependencies bundling

Slide 19

Slide 19 text

Frontend : Alternatives @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H Make test run in jsdom Faster because no browser Faster because no bundle Hard to polyfill

Slide 20

Slide 20 text

@paulsouche / https://github.com/paulsouche / [email protected] Demo ? #typescriptertalk @S_A_N_T_E_C_H

Slide 21

Slide 21 text

Frontend : Stack @paulsouche / https://github.com/paulsouche / [email protected] PRO #typescriptertalk @S_A_N_T_E_C_H

Slide 22

Slide 22 text

Frontend : Config @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 23

Slide 23 text

@paulsouche / https://github.com/paulsouche / [email protected] Demo ? #typescriptertalk @S_A_N_T_E_C_H

Slide 24

Slide 24 text

@paulsouche / https://github.com/paulsouche / [email protected] That’s all folks Never forget #typescriptertalk @S_A_N_T_E_C_H

Slide 25

Slide 25 text

@paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H

Slide 26

Slide 26 text

Questions ? @paulsouche / https://github.com/paulsouche / [email protected] #typescriptertalk @S_A_N_T_E_C_H