This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ npm start | |
| > [email protected] start /Users/uxebu/mocha-sinon-traceur-example | |
| > webpack-dev-server | |
| http://localhost:8080/webpack-dev-server/ | |
| webpack result is served from / | |
| content is served from /Users/uxebu/mocha-sinon-traceur-example | |
| [traceur-loader]: Processing file: /Users/uxebu/mocha-sinon-traceur-example/src/main.js | |
| [traceur-loader]: Current options are: { runtime: true, traceurOptions: {} } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| entry: './src/main', | |
| module: { | |
| loaders: [ | |
| // Transpile any JavaScript file: | |
| { | |
| test: /\.js$/, | |
| loader: 'webpack-traceur?runtime', | |
| exclude: /node_modules/ // <<<<===== prevent traceur to modify all from node_modules | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // should get loaded into tddbin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| switch(points) { | |
| case 0: return 'Love'; | |
| case 1: return 'Fifteen'; | |
| case 2: return 'Thirty'; | |
| case 3: return 'Forty'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pointsMap = [ | |
| 'Love', | |
| 'Fifteen', | |
| 'Thirty', | |
| 'Forty' | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pointsMap = { | |
| 0: 'Love', | |
| 1: 'Fifteen', | |
| 2: 'Thirty', | |
| 3: 'Forty' | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function callTie(points) { | |
| if (points < 3) { | |
| var pointsMap = { | |
| 0: 'Love-All', | |
| 1: 'Fifteen-All', | |
| 2: 'Thirty-All' | |
| }; | |
| return pointsMap[points]; | |
| } | |
| return 'Deuce'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pointsMap = { | |
| 0: 'Love-All', | |
| 1: 'Fifteen-All', | |
| 2: 'Thirty-All' | |
| }; | |
| function callTie(points) { | |
| if (points < 3) { | |
| return pointsMap[points]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function callTie(points) { | |
| return pointsMap[points] || 'Deuce'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pointsMap = { | |
| 0: 'Love-All', | |
| 1: 'Fifteen-All', | |
| 2: 'Thirty-All', | |
| 'default': 'Deuce' | |
| }; | |
| function callTie(points) { | |
| return pointsMap[points] || pointsMap.default; | |
| } |