feature: cloudfunc: get rid of mock-require

This commit is contained in:
coderaiser 2024-03-21 08:36:05 +02:00
parent 6e99c7e3c5
commit fcce26d4e1
2 changed files with 42 additions and 49 deletions

28
common/entity.spec.js Normal file
View file

@ -0,0 +1,28 @@
'use strict';
const test = require('supertape');
const entity = require('./entity');
test('cloudcmd: entity: encode', (t) => {
const result = entity.encode('<hello> ');
const expected = '&lt;hello&gt; ';
t.equal(result, expected, 'should encode entity');
t.end();
});
test('cloudcmd: entity: decode', (t) => {
const result = entity.decode('&lt;hello&gt; ');
const expected = '<hello> ';
t.equal(result, expected, 'should decode entity');
t.end();
});
test('cloudcmd: entity: encode quote', (t) => {
const result = entity.encode('"hello"');
const expected = '&quot;hello&quot;';
t.equal(result, expected, 'should encode entity');
t.end();
});