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() {
|
||||
it('works with single letters', function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let calculator = require ('./calculator.js');
|
||||
const calculator = require ('./calculator.js');
|
||||
|
||||
describe('add', 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() {
|
||||
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:
|
||||
```javascript
|
||||
let helloWorld = require('./helloWorld');
|
||||
const helloWorld = require('./helloWorld');
|
||||
|
||||
describe('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:
|
||||
```javascript
|
||||
let helloWorld = function() {
|
||||
const helloWorld = function() {
|
||||
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:
|
||||
```javascript
|
||||
let helloWorld = function() {
|
||||
const helloWorld = function() {
|
||||
return 'Hello, World!'
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let helloWorld = function() {
|
||||
const helloWorld = function() {
|
||||
return ''
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
let helloWorld = require('./helloWorld');
|
||||
const helloWorld = require('./helloWorld');
|
||||
|
||||
describe('Hello World', function() {
|
||||
it('says hello world', function() {
|
||||
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() {
|
||||
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() {
|
||||
it('works with single words', function() {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
// See https://en.wikipedia.org/wiki/Pig_Latin for more details.
|
||||
|
||||
let pigLatin = require("./pigLatin.js");
|
||||
const pigLatin = require("./pigLatin.js");
|
||||
|
||||
describe('#translate', function() {
|
||||
it('translates a word beginning with a vowel', function() {
|
||||
|
@ -61,4 +61,4 @@ describe('#translate', function() {
|
|||
s = pigLatin.translate("the quick brown fox");
|
||||
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() {
|
||||
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() {
|
||||
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() {
|
||||
it('reverses single word', function() {
|
||||
|
@ -12,4 +12,4 @@ describe('reverseString', function() {
|
|||
xit('works with numbers and punctuation', function() {
|
||||
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() {
|
||||
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() {
|
||||
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 = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let {ftoc, ctof} = require('./tempConversion')
|
||||
const {ftoc, ctof} = require('./tempConversion')
|
||||
|
||||
describe('ftoc', function() {
|
||||
it('works', function() {
|
||||
|
|
Loading…
Reference in New Issue