Merge pull request #9948 from Snuffleupagus/url-polyfill-unit-tests
Add (basic) unit-tests for the non-global `URL` constructor (PR 9868 follow-up)
This commit is contained in:
commit
8a4be24645
@ -16,7 +16,7 @@
|
||||
import {
|
||||
bytesToString, getInheritableProperty, isArrayBuffer, isBool, isEmptyObj,
|
||||
isNum, isSpace, isString, log2, ReadableStream, removeNullCharacters,
|
||||
stringToBytes, stringToPDFString
|
||||
stringToBytes, stringToPDFString, URL
|
||||
} from '../../src/shared/util';
|
||||
import { Dict, Ref } from '../../src/core/primitives';
|
||||
import { XRefMock } from './test_utils';
|
||||
@ -311,4 +311,16 @@ describe('util', function() {
|
||||
expect(typeof readable.getReader).toEqual('function');
|
||||
});
|
||||
});
|
||||
|
||||
describe('URL', function() {
|
||||
it('should return an Object', function() {
|
||||
const url = new URL('https://example.com');
|
||||
expect(typeof url).toEqual('object');
|
||||
});
|
||||
|
||||
it('should have property `href`', function() {
|
||||
const url = new URL('https://example.com');
|
||||
expect(typeof url.href).toEqual('string');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user