Update README with Jest specific language. Update some spec files with new syntax

This commit is contained in:
Michael Frank
2021-03-04 10:42:39 +13:00
parent 91d50288b2
commit e73c68fc01
5 changed files with 28 additions and 22 deletions
+16 -15
View File
@@ -1,25 +1,26 @@
const expect = require('expect');const caesar = require('./caesar')
const expect = require('expect');
const caesar = require('./caesar')
describe('caesar', function() {
it('works with single letters', function() {
expect(caesar('A', 1)).toEqual('B');
test('works with single letters', function() {
expect(caesar('A', 1)).toBe('B');
});
xit('works with words', function() {
expect(caesar('Aaa', 1)).toEqual('Bbb');
test.skip('works with words', function() {
expect(caesar('Aaa', 1)).toBe('Bbb');
});
xit('works with phrases', function() {
expect(caesar('Hello, World!', 5)).toEqual('Mjqqt, Btwqi!');
test.skip('works with phrases', function() {
expect(caesar('Hello, World!', 5)).toBe('Mjqqt, Btwqi!');
});
xit('works with negative shift', function() {
expect(caesar('Mjqqt, Btwqi!', -5)).toEqual('Hello, World!');
test.skip('works with negative shift', function() {
expect(caesar('Mjqqt, Btwqi!', -5)).toBe('Hello, World!');
});
xit('wraps', function() {
expect(caesar('Z', 1)).toEqual('A');
test.skip('wraps', function() {
expect(caesar('Z', 1)).toBe('A');
});
xit('works with large shift factors', function() {
expect(caesar('Hello, World!', 75)).toEqual('Ebiil, Tloia!');
test.skip('works with large shift factors', function() {
expect(caesar('Hello, World!', 75)).toBe('Ebiil, Tloia!');
});
xit('works with large negative shift factors', function() {
expect(caesar('Hello, World!', -29)).toEqual('Ebiil, Tloia!');
test.skip('works with large negative shift factors', function() {
expect(caesar('Hello, World!', -29)).toBe('Ebiil, Tloia!');
});
});