Browsern + Javascript = sant
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Browsern + Javascript = sant

  • 1,279 views
Uploaded on

Björn Skoglund, Valtech. ...

Björn Skoglund, Valtech.
Kärleken övervinner allt. En tydlig trend idag är att isolera sin javascript och testa funktionalitet isolerat från browsern via abstraktioner. Men förr eller senare måste vi alla erkänna att de hör ihop så jag kommer presentera ett experimentellt och annorlunda sätt att garantera funktionalitet i övergången mellan html och javascript.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,279
On Slideshare
149
From Embeds
1,130
Number of Embeds
12

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 1,130

http://www.valtechlabs.se 577
http://valtech.local 252
https://valtech.se 216
http://phoenix-valtech.valtech.se 68
http://valtech.com.local 7
http://phoenix-valtech.azurewebsites.net 3
https://phoenix.valtech.se 2
http://www.google.se 1
http://www.slideee.com 1
http://valtechlabs.se. 1
https://www.google.se 1
http://accessibility_checker.siteimprove.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Björn Skoglund @bjosk http://github.com/bjorns
  • 2. Mot internet!
  • 3. Suitest DOH LBRTW JSUnit Enhance JS QUnit Unit.js RhUnit Crosscheck J3Unit Mocha intern JSNUnit YUI Test JSSpec UnitTesting JSpec Jasmine screw-unit Test.Simple Test.More TestCase TestIt jsUnitTest JSTest JSTest.NET jsUnity RhinoUnit JasUnit FireUnit Js-test-driver Js-test-runner Sinon.js SOAtest Vows Nodeunit Tyrtle wru Compatible Buster.JS Lighttest Chai
  • 4. ”It does not require a DOM.” http://jasmine.github.io
  • 5. JS HTML Säker ? Osäker
  • 6. TYDLIGT! SÄKERT!
  • 7. JS HTML Säker Säker
  • 8. gjut.js
  • 9. • Node.js • Finns i npm • lib-modul eller terminal(gjutc) • Experimentellt gjut.js
  • 10. • Tar annoterad html som input • Validerar din html gjut.js
  • 11. <span>@package.variable</span> ! => ! <span>hej världen!</span> @mickec75 { variable: ”hej världen!” }
  • 12. <div @package.func()></div> => <div id=”dynamisktId”></div> @mickec75 func: function(element) { element.attributes['id'].push('dynamisktId'); }
  • 13. <span @package.success()>Success!</span> <span @!package.success()>Failure</span> => <span>Success!</span> @mickec75
  • 14. <ul> <li @foreach(@func() in @array)> </li> </ul> @mickec75 array: [’Imse’, ’Vimse’, ’Spindel’], func: function(element, value) { element.content.push({ type: ’text', content: value + ’!’ }); }
  • 15. <ul> <li> Imse! </li> <li> Vimse! </li> <li> Spindel! </li> </ul> @mickec75
  • 16. Verifiering
  • 17. @verify .carousel -> .canvas ! @verify label <- input ! @verify exist div#topstory Verifiering
  • 18. Funkar det då?
  • 19. http://openaid.skoglund.io
  • 20. $ npm install gjut -g var gjut = require(’gjut’); ! $ gjutc index.html
  • 21. https://github.com/bjorns/gjut.js
  • 22. Björn Skoglund Tack @bjosk http://github.com/bjorns