Transform 'let' in 'const' where needs be
This commit is contained in:
parent
deb698c09e
commit
00407bdee5
|
@ -1,4 +1,4 @@
|
||||||
let caesar = function() {
|
const caesar = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let caesar = require('./caesar')
|
const caesar = require('./caesar')
|
||||||
|
|
||||||
describe('caesar', function() {
|
describe('caesar', function() {
|
||||||
it('works with single letters', function() {
|
it('works with single letters', function() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let calculator = require ('./calculator.js');
|
const calculator = require ('./calculator.js');
|
||||||
|
|
||||||
describe('add', function() {
|
describe('add', function() {
|
||||||
it('adds 0 and 0', function() {
|
it('adds 0 and 0', function() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let fibonacci = function() {
|
const fibonacci = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let fibonacci = require('./fibonacci')
|
const fibonacci = require('./fibonacci')
|
||||||
|
|
||||||
describe('fibonacci', function() {
|
describe('fibonacci', function() {
|
||||||
it('works', function() {
|
it('works', function() {
|
||||||
|
|
|
@ -10,7 +10,7 @@ This setup should be the same for all of the exercises. The plain javascript fi
|
||||||
|
|
||||||
Let's look at the spec file first:
|
Let's look at the spec file first:
|
||||||
```javascript
|
```javascript
|
||||||
let helloWorld = require('./helloWorld');
|
const helloWorld = require('./helloWorld');
|
||||||
|
|
||||||
describe('Hello World', function() {
|
describe('Hello World', function() {
|
||||||
it('says hello world', function() {
|
it('says hello world', function() {
|
||||||
|
@ -26,7 +26,7 @@ For now you do not need to worry about how to write tests, but you should try to
|
||||||
|
|
||||||
so let's look at the javascript file:
|
so let's look at the javascript file:
|
||||||
```javascript
|
```javascript
|
||||||
let helloWorld = function() {
|
const helloWorld = function() {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ Just to make sure, in case you're confused at this point, the test is telling yo
|
||||||
|
|
||||||
this is what the final function should look like:
|
this is what the final function should look like:
|
||||||
```javascript
|
```javascript
|
||||||
let helloWorld = function() {
|
const helloWorld = function() {
|
||||||
return 'Hello, World!'
|
return 'Hello, World!'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let helloWorld = function() {
|
const helloWorld = function() {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
let helloWorld = require('./helloWorld');
|
const helloWorld = require('./helloWorld');
|
||||||
|
|
||||||
describe('Hello World', function() {
|
describe('Hello World', function() {
|
||||||
it('says hello world', function() {
|
it('says hello world', function() {
|
||||||
expect(helloWorld()).toEqual('Hello, World!');
|
expect(helloWorld()).toEqual('Hello, World!');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let leapYears = function() {
|
const leapYears = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let leapYears = require('./leapYears')
|
const leapYears = require('./leapYears')
|
||||||
|
|
||||||
describe('leapYears', function() {
|
describe('leapYears', function() {
|
||||||
it('works with non century years', function() {
|
it('works with non century years', function() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let palindromes = function() {
|
const palindromes = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let palindromes = require('./palindromes')
|
const palindromes = require('./palindromes')
|
||||||
|
|
||||||
describe('palindromes', function() {
|
describe('palindromes', function() {
|
||||||
it('works with single words', function() {
|
it('works with single words', function() {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
// See https://en.wikipedia.org/wiki/Pig_Latin for more details.
|
// See https://en.wikipedia.org/wiki/Pig_Latin for more details.
|
||||||
|
|
||||||
let pigLatin = require("./pigLatin.js");
|
const pigLatin = require("./pigLatin.js");
|
||||||
|
|
||||||
describe('#translate', function() {
|
describe('#translate', function() {
|
||||||
it('translates a word beginning with a vowel', function() {
|
it('translates a word beginning with a vowel', function() {
|
||||||
|
@ -61,4 +61,4 @@ describe('#translate', function() {
|
||||||
s = pigLatin.translate("the quick brown fox");
|
s = pigLatin.translate("the quick brown fox");
|
||||||
expect(s).toEqual("ethay ickquay ownbray oxfay");
|
expect(s).toEqual("ethay ickquay ownbray oxfay");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let removeFromArray = function() {
|
const removeFromArray = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let removeFromArray = require('./removeFromArray')
|
const removeFromArray = require('./removeFromArray')
|
||||||
|
|
||||||
describe('removeFromArray', function() {
|
describe('removeFromArray', function() {
|
||||||
it('removes a single value', function() {
|
it('removes a single value', function() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let repeatString = function() {
|
const repeatString = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let repeatString = require('./repeatString')
|
const repeatString = require('./repeatString')
|
||||||
|
|
||||||
describe('repeatString', function() {
|
describe('repeatString', function() {
|
||||||
it('repeats the string', function() {
|
it('repeats the string', function() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
let reverseString = function() {
|
const reverseString = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = reverseString
|
module.exports = reverseString
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let reverseString = require('./reverseString')
|
const reverseString = require('./reverseString')
|
||||||
|
|
||||||
describe('reverseString', function() {
|
describe('reverseString', function() {
|
||||||
it('reverses single word', function() {
|
it('reverses single word', function() {
|
||||||
|
@ -12,4 +12,4 @@ describe('reverseString', function() {
|
||||||
xit('works with numbers and punctuation', function() {
|
xit('works with numbers and punctuation', function() {
|
||||||
expect(reverseString('123! abc!')).toEqual('!cba !321')
|
expect(reverseString('123! abc!')).toEqual('!cba !321')
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let snakeCase = function() {
|
const snakeCase = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let snakeCase = require('./snakeCase')
|
const snakeCase = require('./snakeCase')
|
||||||
|
|
||||||
describe('snakeCase', function() {
|
describe('snakeCase', function() {
|
||||||
it('works with simple lowercased phrases', function() {
|
it('works with simple lowercased phrases', function() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let sumAll = function() {
|
const sumAll = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let sumAll = require('./sumAll')
|
const sumAll = require('./sumAll')
|
||||||
|
|
||||||
describe('sumAll', function() {
|
describe('sumAll', function() {
|
||||||
it('sums numbers within the range', function() {
|
it('sums numbers within the range', function() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
let ftoc = function() {
|
const ftoc = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let ctof = function() {
|
const ctof = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
let {ftoc, ctof} = require('./tempConversion')
|
const {ftoc, ctof} = require('./tempConversion')
|
||||||
|
|
||||||
describe('ftoc', function() {
|
describe('ftoc', function() {
|
||||||
it('works', function() {
|
it('works', function() {
|
||||||
|
|
Loading…
Reference in New Issue