polyfill coverage testing
parent
dec9adab13
commit
b45567450f
|
|
@ -5,9 +5,10 @@ import * as cacheFunctions from '../helpers/functions.cache.js';
|
|||
import * as iconFunctions from '../helpers/functions.icons.js';
|
||||
import * as sqlFilterFunctions from '../helpers/functions.sqlFilters.js';
|
||||
import * as userFunctions from '../helpers/functions.user.js';
|
||||
import * as polyfills from '../helpers/polyfills.js';
|
||||
describe('config.cemetery.ssm', () => {
|
||||
it('Sorts burial site names', () => {
|
||||
const grave2 = 'XX-B1-G2';
|
||||
const grave2 = 'XX-B1-G2A';
|
||||
const grave10 = 'XX-B1-G10';
|
||||
assert.ok(lotNameSortNameFunction(grave2) < lotNameSortNameFunction(grave10));
|
||||
});
|
||||
|
|
@ -334,3 +335,13 @@ describe('functions.user', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
describe('plyfills', () => {
|
||||
it('applys Object.hasOwn polyfill', () => {
|
||||
delete Object.hasOwn;
|
||||
assert.ok(Object.hasOwn === undefined);
|
||||
polyfills.applyPolyfills();
|
||||
assert.ok(Object.hasOwn !== undefined);
|
||||
const testObject = { foo: 'bar' };
|
||||
assert.ok(Object.hasOwn(testObject, 'foo'));
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8,12 +8,16 @@ import * as iconFunctions from '../helpers/functions.icons.js'
|
|||
import * as sqlFilterFunctions from '../helpers/functions.sqlFilters.js'
|
||||
import * as userFunctions from '../helpers/functions.user.js'
|
||||
|
||||
import * as polyfills from '../helpers/polyfills.js'
|
||||
|
||||
describe('config.cemetery.ssm', () => {
|
||||
it('Sorts burial site names', () => {
|
||||
const grave2 = 'XX-B1-G2'
|
||||
const grave2 = 'XX-B1-G2A'
|
||||
const grave10 = 'XX-B1-G10'
|
||||
|
||||
assert.ok(lotNameSortNameFunction(grave2) < lotNameSortNameFunction(grave10))
|
||||
assert.ok(
|
||||
lotNameSortNameFunction(grave2) < lotNameSortNameFunction(grave10)
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -511,3 +515,17 @@ describe('functions.user', () => {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('plyfills', () => {
|
||||
it('applys Object.hasOwn polyfill', () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
delete (Object as any).hasOwn
|
||||
assert.ok(Object.hasOwn === undefined)
|
||||
|
||||
polyfills.applyPolyfills()
|
||||
assert.ok(Object.hasOwn !== undefined)
|
||||
|
||||
const testObject = { foo: 'bar' }
|
||||
assert.ok(Object.hasOwn(testObject, 'foo'))
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue