1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-23 18:29:15 +03:00
Files
phpmyadmin/test/javascript/functions.test.js
Fawzi Abdulfattah 5bd1e909c7 Linting
Signed-off-by: Fawzi Abdulfattah <iifawzie@gmail.com>
2023-01-15 04:04:41 +02:00

18 lines
638 B
JavaScript

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