Update caesar.spec.js

Proposing a change for caesar.spec.js for test 3 ('works with phrases') and test 4 ('works with negative shift'). The test for 'wraps' is supposed to come after these ones, but currently using the word "World!" in the earlier tests with a 5 key shift will require that wraps are already working, thus the spec test will fail even if the code is appropriate for phrases and negative shifts. If the learning process is to move one by one progressively through the spec tests, then I think it would be better not to require wraps to be working until the actual 'wraps' requirement in test 5.  I believe simply replacing the word "World!" with "There!" should solve the issue.
This commit is contained in:
dm-murphy 2020-07-02 14:50:37 -04:00 committed by GitHub
parent 888383a44e
commit 25f18760cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -8,10 +8,10 @@ describe('caesar', function() {
expect(caesar('Aaa', 1)).toEqual('Bbb');
});
xit('works with phrases', function() {
expect(caesar('Hello, World!', 5)).toEqual('Mjqqt, Btwqi!');
expect(caesar('Hello, There!', 5)).toEqual('Mjqqt, Ymjwj!');
});
xit('works with negative shift', function() {
expect(caesar('Mjqqt, Btwqi!', -5)).toEqual('Hello, World!');
expect(caesar('Mjqqt, Ymjwj!', -5)).toEqual('Hello, There!');
});
xit('wraps', function() {
expect(caesar('Z', 1)).toEqual('A');