mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
36 lines
1020 B
JavaScript
Executable File
36 lines
1020 B
JavaScript
Executable File
import { Options } from '../Config/Options.js';
|
|
|
|
describe('OptionsTest', function ()
|
|
{
|
|
'use strict';
|
|
|
|
describe('testDefault', function ()
|
|
{
|
|
it('Testing default functionality', function ()
|
|
{
|
|
let option = new Options();
|
|
expect(option.get('invalid')).toBe(null);
|
|
expect(option.remove('invalid')).toBeFalsy();
|
|
});
|
|
});
|
|
|
|
describe('testSetGet', function ()
|
|
{
|
|
it('Testing set/get functionality', function ()
|
|
{
|
|
let option = new Options();
|
|
|
|
expect(option.set('a', 2)).toBeTruthy();
|
|
expect(option.get('a')).toBe(2);
|
|
expect(option.set('a', 3)).toBeFalsy();
|
|
expect(option.get('a')).toBe(2);
|
|
expect(option.set('a', 3, true)).toBeTruthy();
|
|
expect(option.get('a')).toBe(3);
|
|
|
|
expect(option.remove('a')).toBeTruthy();
|
|
expect(option.get('a')).toBe(null);
|
|
expect(option.remove('a')).toBeFalsy();
|
|
});
|
|
});
|
|
});
|