-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.test.js
32 lines (27 loc) · 1.13 KB
/
app.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// test script for parent and child documents.
const nigma = require('./src/index');
const message = 'Encode this text please';
describe('Test if JEST is working', () => {
test(`Should return true if TEST runner is OK`, () => {
expect(1 + 1).toBe(2);
});
});
/*
Since I'm new to JS, I don't know how to implement this sort of testing. I keep it in comments so that this week I can take it and post it in stackoverflow or some other support site.
function cipherTest(cipherObject, message, encodedMessage) {
return test(`Should Encode message Using ${cipherObject.getMethod()} module and return a perfect Match`, () => {
console.log(`Running test ${cipherObject.getMethod()}`);
expect(cipherObject.encode()).toBe(encodedMessage);
});
}
*/
// -------------------------------------ENIGMA UNIT TEST-------------------------------------
/*
const method = "Enigma";
const encoded = "FOKXHYXLOPZMLMHZOMEF";
const generator = new nigma.Enigma(message);
test(`Should Encode message Using ${method} module and return a perfect Match`, () => {
console.log(`Running test ${method}`);
expect(generator.encode(message)).toBe(encoded);
});
*/