+ All Categories
Home > Internet > Tester ses Behaviors Marionette.js

Tester ses Behaviors Marionette.js

Date post: 13-Jan-2017
Category:
Upload: nicolas-carlo
View: 186 times
Download: 0 times
Share this document with a friend
13
1 TESTER TESTER SES SES BEHAVIORS BEHAVIORS MARIONETTE.JS MARIONETTE.JS
Transcript
Page 1: Tester ses Behaviors Marionette.js

1

TESTERTESTER SES SES BEHAVIORSBEHAVIORS MARIONETTE.JS MARIONETTE.JS

Page 3: Tester ses Behaviors Marionette.js

3 . 1

KEZAKO KEZAKO BEHAVIORS BEHAVIORS ??> PETIT CHECK-UP> PETIT CHECK-UP

Page 4: Tester ses Behaviors Marionette.js

3 . 2

FROM ZE DOCSFROM ZE DOCS

http://marionettejs.com/docs/v2.4.3/marionette.behavior.html

“ A Behavior is an isolated set of DOM / user interactionsthat can be mixed into any View or another Behavior.

“ Behaviors allow you to blackbox View-specific interactions intoportable logical chunks, keeping your Views simple and your code DRY.

Page 5: Tester ses Behaviors Marionette.js

3 . 3

CONCRÈTEMENTCONCRÈTEMENT

http://slides.com/stephanebachelier/marionettebehaviors#/

Explications, implémentation et détails techniquestrès bien présentés par au

meetup Stéphane Bachelier

Backbone.js Paris S01E06

Page 7: Tester ses Behaviors Marionette.js

4 . 1

TESTER SES TESTER SES BEHAVIORSBEHAVIORS, YAKA !, YAKA !> LES PROBLÉMATIQUES> LES PROBLÉMATIQUES

Page 8: Tester ses Behaviors Marionette.js

4 . 2

PB #1 : TESTER L'API ?PB #1 : TESTER L'API ?const Alert = Marionette.Behavior.extend( {

defaults: { title: "Alert!", message: "Not really urgent" },

events: { "click": "emitAlert" },

emitAlert() { alert( this.options.message ); }

} );

it( "should emit an alert", () => {

// => This won't work expect( Behavior.emitAlert() ).toEmitAnAlert();

} );

Page 9: Tester ses Behaviors Marionette.js

4 . 3

PB #2 : COUPLAGE AVEC LA VUEPB #2 : COUPLAGE AVEC LA VUE

Tester une Behavior indépendamment d'une vue :

beaucoup de setuppeu de valeur ajoutéene vérifie pas que l'interactionBehavior-View fonctionne bien dans notre réalité

Page 10: Tester ses Behaviors Marionette.js

4 . 4

PB #3 : DUPLICATION DU CODE DE TESTPB #3 : DUPLICATION DU CODE DE TEST

Tester l'interaction Behavior-View dans chaque test de vue…

Page 11: Tester ses Behaviors Marionette.js

5 . 1

SOLUTIONSOLUTION PROPOSÉE PROPOSÉE

https://github.com/nicoespeon/testing-marionette-behaviors

http://www.nicoespeon.com/fr/2015/11/tester-behaviors-marionette/

Page 12: Tester ses Behaviors Marionette.js

5 . 2

ARTICLES SUR LA QUESTIONARTICLES SUR LA QUESTION

http://spin.atomicobject.com/2014/09/11/marionette-behaviors-overview/

http://spin.atomicobject.com/2014/09/12/testing-marionette-js-behaviors/

Page 13: Tester ses Behaviors Marionette.js

6

MERCI !MERCI ! DES QUESTIONS ? DES QUESTIONS ?


Recommended