SlideShare a Scribd company logo
© 2011 @eriwen
Eric Wendelin
Blog: eriwen.com
Twitter: @eriwen
Code: git.io/eric
(      °□°                ɐpuǝƃV

• Tools that help your JS not suck
• How to create a build for your client-side
  code
• Automation with Jenkins
• The hard part
• Unicorns
The Situation
Programmers are expensive

Must prevent them from doing
 things below their pay grade
How do you do that?

Automate tasks that don't
require mental participation
Programmers are clever

 Must force them to write
code for the next engineer
Better for the next engineer?

Must enforce conventions
 that make the code more
      understandable
?
First things first

We need automation tools
Static Analysis
JavaScript + Jenkins = Winning!
JSHint


jshint file.js --config config.json




          jshint.org
CSSLint


csslint --rules=rule,rule2 file.css




          csslint.net
Testing
Unit-testing

• Jasmine (pivotal.github.com/jasmine)
• QUnit (docs.jquery.com/QUnit)
• YUI Test (yuilibrary.com/yui/docs/test)
• Mocha (visionmedia.github.com/mocha)
• Lots of others...
PhantomJS


phantomjs your-runner.js file.html




        phantomjs.org
Xvfb
JsTestDriver


java -jar JsTestDriver.jar --tests all




code.google.com/p/js-test-driver/
Functional testing

• Selenium (seleniumhq.org)
• CasperJS (github.com/n1k0/casperjs)
• zombie.js (zombie.labnotes.org)
Documentation
jsduck


jsduck src/js --output target/docs




github.com/senchalabs/jsduck
Page Speed
Closure Compiler

 java -jar compiler.jar --js file.js
     --js_output_file file.min.js



code.google.com/closure/compiler
YUI Compressor

     java -jar yuicompressor.jar -o
         '.css$:-min.css' *.css



developer.yahoo.com/yui/compressor
Combine and gzip

cat file1.js file2.js >> combined.js
gzip combined.js
mv combined.js{.gz,}
?
The Build
Build Steps

• Static Analysis
• File Optimization (for production)
• Automated Testing
• Documentation
• Report Results
Gradle
Don't have a build?
html5boilerplate.com
Introducing the Gradle
      Web Suite
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
git.io/gradlejs
git.io/gradlecss
git.io/gradlehtml
jenkins-ci.org
Crazy Simple Setup

wget http://mirrors.jenkins-
ci.org/war/latest/jenkins.war


java -jar jenkins.war
Source Control Plugins
• Git
• Mercurial
• Bazaar
• Subversion
• CVS
• Lots more...
Build System Plugins

• Gradle
• Maven
• Ant
• Rake
• Lots more...
Runs pretty much
       everything
• Ruby
• Python
• NodeJS
• Groovy
• Shell
• Lots more...
Build Health Plugins

• Violations Plugin
• Selenium Plugin
• Cobertura Plugin
• Task Scanner Plugin
• ...and, of course, Chuck Norris Plugin
The really hard part
5 Stages of JS CI
• No build server
• Pulls from source control and runs metrics
• Runs unit tests and fails build if necessary.
  One button push to staging/production env
• Unit and acceptance tests run. Metrics
  affect build stability
• Code deployed on every push that passes
  the build
Helpful Tweeters
@ariyahidayat works on #phantomjs
@gseguin helped me with QUnit/Phantom
@builddoctor general CI advocate/guru
@jfroma does cool #jsci on Windows
@jamescarr could've given this talk well
One more thing...
JavaScript + Jenkins = Winning!
LCOV to Cobertura converter


     git.io/ltc
JavaScript + Jenkins = Winning!
Code at: git.io/eric

Blog: eriwen.com
Twitter: @eriwen

More Related Content

PPTX
Fuzzy Logic Ppt
PDF
Creating a Healthcare Data Fabric, and Providing a Single, Unified, and Curat...
PPTX
AI Everywhere: How Microsoft is Democratizing AI
PPT
Datacube
PDF
Validasi ide Menggunakan Javelin Board (Idea Validation)
PPTX
Generative AI
DOCX
Java (Netbeans) Polymorphism - Object Oriented Programming (OOP)
PDF
Pewarisan, Polimorfisme, dan Interface
Fuzzy Logic Ppt
Creating a Healthcare Data Fabric, and Providing a Single, Unified, and Curat...
AI Everywhere: How Microsoft is Democratizing AI
Datacube
Validasi ide Menggunakan Javelin Board (Idea Validation)
Generative AI
Java (Netbeans) Polymorphism - Object Oriented Programming (OOP)
Pewarisan, Polimorfisme, dan Interface

What's hot (12)

PDF
[RPL2] Class Diagram dan Relasinya (2)
PDF
Data Science Training | Data Science Tutorial for Beginners | Data Science wi...
PPTX
Introduction to Big Data
PDF
4 v's of Big Data | The Knowledge Academy
PPTX
PDF
Future of Data Engineering
PPTX
Data mining: Classification and prediction
PDF
Overview of big data in cloud computing
PDF
Dimensionality Reduction
PPTX
06 Community Detection
PPT
Rancangan perangkat lunak
PDF
Data Management (Relational Database)
[RPL2] Class Diagram dan Relasinya (2)
Data Science Training | Data Science Tutorial for Beginners | Data Science wi...
Introduction to Big Data
4 v's of Big Data | The Knowledge Academy
Future of Data Engineering
Data mining: Classification and prediction
Overview of big data in cloud computing
Dimensionality Reduction
06 Community Detection
Rancangan perangkat lunak
Data Management (Relational Database)
Ad

Similar to JavaScript + Jenkins = Winning! (20)

PDF
Introduction To Web Application Testing
PPTX
A modern architecturereview–usingcodereviewtools-ver-3.5
 
PPTX
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
PDF
2015 jcconf-h2s-devops-practice
PDF
Quick start with AngularJS
PDF
Test driven development_continuous_integration
PDF
Testing with Codeception
PDF
Guides To Analyzing WebKit Performance
PDF
From MEAN to the MERN Stack
PPTX
Static Code Analysis PHP[tek] 2023
PPTX
Selenium practical
PDF
Angular 2 overview
PPTX
Effective .NET Core Unit Testing with SQLite and Dapper
PPTX
Effective .NET Core Unit Testing with SQLite and Dapper
PDF
JavaScript all the things! - FullStack 2017
PPTX
Browser Automated Testing Frameworks - Nightwatch.js
PDF
Spring insight what just happened
KEY
Let's run JavaScript Everywhere
ODP
Behat Workshop at WeLovePHP
PDF
John Resig Beijing 2010 (English Version)
Introduction To Web Application Testing
A modern architecturereview–usingcodereviewtools-ver-3.5
 
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
2015 jcconf-h2s-devops-practice
Quick start with AngularJS
Test driven development_continuous_integration
Testing with Codeception
Guides To Analyzing WebKit Performance
From MEAN to the MERN Stack
Static Code Analysis PHP[tek] 2023
Selenium practical
Angular 2 overview
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
JavaScript all the things! - FullStack 2017
Browser Automated Testing Frameworks - Nightwatch.js
Spring insight what just happened
Let's run JavaScript Everywhere
Behat Workshop at WeLovePHP
John Resig Beijing 2010 (English Version)
Ad

More from Eric Wendelin (10)

PDF
What's new in Gradle 4.0
PDF
Building the Web with Gradle
PDF
Gradle by Example
PDF
Gradle 3.0: Unleash the Daemon!
PDF
Test your Javascript! v1.1
PDF
Groovy-er desktop applications with Griffon
PDF
Intro to Hadoop
KEY
Javascript Stacktrace Ignite
PDF
Apache Avro and You
KEY
Testing Hadoop jobs with MRUnit
What's new in Gradle 4.0
Building the Web with Gradle
Gradle by Example
Gradle 3.0: Unleash the Daemon!
Test your Javascript! v1.1
Groovy-er desktop applications with Griffon
Intro to Hadoop
Javascript Stacktrace Ignite
Apache Avro and You
Testing Hadoop jobs with MRUnit

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
cuic standard and advanced reporting.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Machine learning based COVID-19 study performance prediction
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
sap open course for s4hana steps from ECC to s4
Review of recent advances in non-invasive hemoglobin estimation
Chapter 3 Spatial Domain Image Processing.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Big Data Technologies - Introduction.pptx
Spectroscopy.pptx food analysis technology
20250228 LYD VKU AI Blended-Learning.pptx
cuic standard and advanced reporting.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
The AUB Centre for AI in Media Proposal.docx
Dropbox Q2 2025 Financial Results & Investor Presentation
Building Integrated photovoltaic BIPV_UPV.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Electronic commerce courselecture one. Pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

JavaScript + Jenkins = Winning!