Skip to content

Instantly share code, notes, and snippets.

$ 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: {} }
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
}
// should get loaded into tddbin
switch(points) {
case 0: return 'Love';
case 1: return 'Fifteen';
case 2: return 'Thirty';
case 3: return 'Forty';
}
pointsMap = [
'Love',
'Fifteen',
'Thirty',
'Forty'
];
pointsMap = {
0: 'Love',
1: 'Fifteen',
2: 'Thirty',
3: 'Forty'
};
function callTie(points) {
if (points < 3) {
var pointsMap = {
0: 'Love-All',
1: 'Fifteen-All',
2: 'Thirty-All'
};
return pointsMap[points];
}
return 'Deuce';
var pointsMap = {
0: 'Love-All',
1: 'Fifteen-All',
2: 'Thirty-All'
};
function callTie(points) {
if (points < 3) {
return pointsMap[points];
}
function callTie(points) {
return pointsMap[points] || 'Deuce';
}
var pointsMap = {
0: 'Love-All',
1: 'Fifteen-All',
2: 'Thirty-All',
'default': 'Deuce'
};
function callTie(points) {
return pointsMap[points] || pointsMap.default;
}