Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
inventionpro committed Dec 16, 2024
1 parent 93ec767 commit caca4cd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/md5.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { describe, it } = require('node:test');
const assert = require('node:assert');
const api = require('../apis/md5.js');

describe('Hex api', () => {
describe('MD5 api', () => {
it('should error on empty', async () => {
let req = {query:{}};
let errored = false;
Expand Down
27 changes: 27 additions & 0 deletions tests/reverse.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { describe, it } = require('node:test');
const assert = require('node:assert');
const api = require('../apis/reverse.js');

describe('Hex api', () => {
it('should error on empty', async () => {
let req = {query:{}};
let errored = false;
let res = {
error: function(){errored=true}
};
api.execute(req,res);
assert.strictEqual(errored, true);
});
it('should transform hello to olleh', async () => {
let req = {query:{type:'encode',text:'hello'}};
let errored = false;
let json = null;
let res = {
error: function(){errored=true},
json: function(j){json=j}
};
api.execute(req,res);
assert.strictEqual(errored, false);
assert.strictEqual(json.text, 'olleh');
});
});
2 changes: 1 addition & 1 deletion tests/sha256.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { describe, it } = require('node:test');
const assert = require('node:assert');
const api = require('../apis/sha256.js');

describe('Hex api', () => {
describe('Sha256 api', () => {
it('should error on empty', async () => {
let req = {query:{}};
let errored = false;
Expand Down
2 changes: 1 addition & 1 deletion tests/sha512.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { describe, it } = require('node:test');
const assert = require('node:assert');
const api = require('../apis/sha512.js');

describe('Hex api', () => {
describe('Sha512 api', () => {
it('should error on empty', async () => {
let req = {query:{}};
let errored = false;
Expand Down

0 comments on commit caca4cd

Please sign in to comment.