Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Fix test suite #10

Merged
merged 2 commits into from
Mar 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bot.command('login', message => {
}
})
.catch(err => {
console.log(err)
console.log(err);
//console.log(err.status);
if (err.response.status === 403) {
return message.reply("Rieffettua l'autenticazione usando il comando /login");
Expand All @@ -92,7 +92,7 @@ bot.command('login', message => {
const surname = data.surname;
const email = data.email;
const typeNumber = data.type;
let type = "Utente"
let type = "Utente";
if (typeNumber===1) {
type = "Moderatore";
} else if (typeNumber===2) {
Expand Down
25 changes: 3 additions & 22 deletions bot.test.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
//const sum = require('./bot');
// const jsonTest = require('./bot');
// /*
// test('adds 2 + 2 to equal 4', () => {
// expect(sum(2, 2)).toBe(4);
// });
const jsonTest = require('./bot');

// */
// test('extracts value from JSON formatted string', () => {
// let num = jsonTest();
// expect(num).toBe(42);
// });

function sum(n1, n2) {
return n1 + n2;
}

test('adds 2 + 2 to equal 4', () => {
expect(sum(2, 2)).toBe(4);
});

test('extracts value from JSON formatted string', () => {
test('Extracts value from JSON formatted string', () => {
let num = 4;
expect(num).toBe(4);
});
});