convert indentation to tabs
This commit is contained in:
parent
f8910e4f30
commit
7ef7e3c3dc
22 changed files with 1985 additions and 765 deletions
|
|
@ -17,56 +17,56 @@ var fail_count = 0;
|
|||
|
||||
export const run_tests = (silent: boolean): number => {
|
||||
|
||||
// Run through each test
|
||||
for (var test of tests) {
|
||||
// Run through each test
|
||||
for (var test of tests) {
|
||||
|
||||
|
||||
let response = HANDLE_MESSAGE({
|
||||
message: test.msg_meta.message,
|
||||
level: test.msg_meta.level,
|
||||
user: TEST_USER,
|
||||
cooldown: false,
|
||||
source: test.msg_meta.source,
|
||||
channel: test.msg_meta.channel || TEST_CHANNEL,
|
||||
test: true
|
||||
});
|
||||
let response = HANDLE_MESSAGE({
|
||||
message: test.msg_meta.message,
|
||||
level: test.msg_meta.level,
|
||||
user: TEST_USER,
|
||||
cooldown: false,
|
||||
source: test.msg_meta.source,
|
||||
channel: test.msg_meta.channel || TEST_CHANNEL,
|
||||
test: true
|
||||
});
|
||||
|
||||
|
||||
// If the confirmation message is defined, trigger a confirmation
|
||||
if (test.confirm_msg) {
|
||||
response = HANDLE_MESSAGE({
|
||||
message: test.confirm_msg.message,
|
||||
level: test.confirm_msg.level,
|
||||
user: TEST_USER,
|
||||
cooldown: false,
|
||||
source: test.confirm_msg.source,
|
||||
channel: test.msg_meta.channel || TEST_CHANNEL,
|
||||
test: true
|
||||
});
|
||||
};
|
||||
// If the confirmation message is defined, trigger a confirmation
|
||||
if (test.confirm_msg) {
|
||||
response = HANDLE_MESSAGE({
|
||||
message: test.confirm_msg.message,
|
||||
level: test.confirm_msg.level,
|
||||
user: TEST_USER,
|
||||
cooldown: false,
|
||||
source: test.confirm_msg.source,
|
||||
channel: test.msg_meta.channel || TEST_CHANNEL,
|
||||
test: true
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// Compare outputs
|
||||
if (test.expected_return != response) {
|
||||
fail_count++;
|
||||
if (!silent) {
|
||||
console.log("=====================================================");
|
||||
console.log(`Test ${test.id} failed`);
|
||||
console.log(` Expected: "${test.expected_return}"`);
|
||||
console.log(` Received: "${response}"`);
|
||||
};
|
||||
};
|
||||
};
|
||||
// Compare outputs
|
||||
if (test.expected_return != response) {
|
||||
fail_count++;
|
||||
if (!silent) {
|
||||
console.log("=====================================================");
|
||||
console.log(`Test ${test.id} failed`);
|
||||
console.log(` Expected: "${test.expected_return}"`);
|
||||
console.log(` Received: "${response}"`);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Check if we are being silent
|
||||
if (!silent && fail_count > 0) {
|
||||
console.log("=====================================================");
|
||||
};
|
||||
// Check if we are being silent
|
||||
if (!silent && fail_count > 0) {
|
||||
console.log("=====================================================");
|
||||
};
|
||||
|
||||
|
||||
// Output summary
|
||||
console.log(`Tests: ${fail_count} tests failed out of ${tests.length} tests.`);
|
||||
console.log(` ${Math.round(((tests.length - fail_count) / tests.length) * 100)}% passed`);
|
||||
return fail_count;
|
||||
// Output summary
|
||||
console.log(`Tests: ${fail_count} tests failed out of ${tests.length} tests.`);
|
||||
console.log(` ${Math.round(((tests.length - fail_count) / tests.length) * 100)}% passed`);
|
||||
return fail_count;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue