Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Javascript testing for Python developers

Javascript testing for Python developers

Talk from GlasgowJS about how we increased the test coverage at Twig World from ~8% to over 90%

Aaron Bassett

May 06, 2014
Tweet

More Decks by Aaron Bassett

Other Decks in Programming

Transcript

  1. • 86MB Repo • 205,684 lines of code • 70,378

    lines of Python • 21 contributors • First commit July 26th, 2011 - 3+ years
 (Initial Commit. Models for Basic apps)
  2. “we have as many testers as we have developers. And

    testers spend all their time testing, and developers spend half their time testing. We're more of a testing, a quality software organization than we're a software organization.”
  3. “we have as many testers as we have developers. And

    testers spend all their time testing, and developers spend half their time testing. We're more of a testing, a quality software organization than we're a software organization.” – Bill Gates, Microsoft
  4. • 25MB Repo • 86,098 lines of code • 36,491

    lines of Python • 18 contributors • First commit Sept 3rd, 2013 - <1 year
 (Awww yis)
  5. 1 describe 'Calculator', -> 2 3 it 'can add two

    positive numbers', -> 4 calculator = new Calculator() 5 result = calculator.add 2, 3 6 expect(result).toBe 5
  6. 1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <script src="jasmine-reporters/ext/jasmine.js"></script>

    5 <script src="jasmine-reporters/ext/jasmine-html.js"></script> 6 <script src="jasmine-reporters/src/jasmine.console_reporter.js"></script> 7 <script src="jasmine-reporters/src/jasmine.junit_reporter.js"></script> 8 </head> 9 10 <body> 11 <script> 12 jasmine.getEnv().addReporter(new jasmine.ConsoleReporter()); 13 jasmine.getEnv().addReporter(new jasmine.TrivialReporter()); 14 jasmine.getEnv().execute(); 15 </script> 16 </body> 17 </html>
  7. 1 language: node_js 2 node_js: 3 - '0.10' 4 script:

    phantomjs phantom-jasmine.js SpecRunner.html 5 before_script: 6 - 'npm install -g coffee-script' 7 - 'coffee --compile --output static/ src/'
  8. 1 before_install: 2 - sudo add-apt-repository -y ppa:chris-lea/node.js 3 -

    sudo apt-get update 4 - sudo apt-get install nodejs 5 - sudo npm install -g coffee-script
  9. 1 language: node_js 2 node_js: 3 - '0.10' 4 script:

    phantomjs phantom-jasmine.js SpecRunner.html 5 before_script: 6 - 'npm install -g coffee-script' 7 - 'coffee --compile --output static/ src/‘