Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add (basic) unit-tests for the non-global URL constructor (PR 9868 follow-up) #9948

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion test/unit/util_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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');
});
});
});