phpmyadmin/tests/javascript/functions.test.ts
Maurício Meneghini Fauth d65d0b220c
Remove the Functions JS global object
Exports each function individually and removes the Functions global
object.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-07-27 15:38:41 -03:00

18 lines
644 B
TypeScript

/* eslint-env node, jest */
import { stringifyJSON } from '../../resources/js/src/modules/functions.ts';
describe('Functions', () => {
describe('Testing stringifyJSON', function () {
test('Should return the stringified JSON input', () => {
const stringifiedJSON = stringifyJSON('{ "lang": "php"}', null, 4);
expect(stringifiedJSON).toEqual('{\n "lang": "php"\n}');
});
test('Should return the input as it is', () => {
const stringifiedJSON = stringifyJSON('{ "name": "notvalid}');
expect(stringifiedJSON).toEqual('{ "name": "notvalid}');
});
});
});