Fix failing tests
This commit is contained in:
parent
2d57d96e62
commit
a8ab0b7dab
|
@ -117,6 +117,6 @@
|
|||
},
|
||||
"prettier": {
|
||||
"semi": false,
|
||||
"single-quote": true
|
||||
"singleQuote": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
function createPackageURL(packageName, version, filename, search) {
|
||||
let pathname = `/${packageName}`
|
||||
|
||||
if (version != null) pathname += `@${version}`
|
||||
|
||||
if (filename) pathname += filename
|
||||
|
||||
if (search) pathname += search
|
||||
|
||||
return pathname
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ describe('parsePackageURL', () => {
|
|||
it('parses plain packages', () => {
|
||||
expect(parsePackageURL('/history@1.0.0/umd/history.min.js')).toEqual({
|
||||
pathname: '/history@1.0.0/umd/history.min.js',
|
||||
search: '',
|
||||
search: null,
|
||||
query: {},
|
||||
packageName: 'history',
|
||||
packageVersion: '1.0.0',
|
||||
|
@ -15,7 +15,7 @@ describe('parsePackageURL', () => {
|
|||
it('parses plain packages with a hyphen in the name', () => {
|
||||
expect(parsePackageURL('/query-string@5.0.0/index.js')).toEqual({
|
||||
pathname: '/query-string@5.0.0/index.js',
|
||||
search: '',
|
||||
search: null,
|
||||
query: {},
|
||||
packageName: 'query-string',
|
||||
packageVersion: '5.0.0',
|
||||
|
@ -26,7 +26,7 @@ describe('parsePackageURL', () => {
|
|||
it('parses plain packages with no version specified', () => {
|
||||
expect(parsePackageURL('/query-string/index.js')).toEqual({
|
||||
pathname: '/query-string/index.js',
|
||||
search: '',
|
||||
search: null,
|
||||
query: {},
|
||||
packageName: 'query-string',
|
||||
packageVersion: 'latest',
|
||||
|
@ -37,7 +37,7 @@ describe('parsePackageURL', () => {
|
|||
it('parses plain packages with version spec', () => {
|
||||
expect(parsePackageURL('/query-string@>=4.0.0/index.js')).toEqual({
|
||||
pathname: '/query-string@>=4.0.0/index.js',
|
||||
search: '',
|
||||
search: null,
|
||||
query: {},
|
||||
packageName: 'query-string',
|
||||
packageVersion: '>=4.0.0',
|
||||
|
@ -48,7 +48,7 @@ describe('parsePackageURL', () => {
|
|||
it('parses scoped packages', () => {
|
||||
expect(parsePackageURL('/@angular/router@4.3.3/src/index.d.ts')).toEqual({
|
||||
pathname: '/@angular/router@4.3.3/src/index.d.ts',
|
||||
search: '',
|
||||
search: null,
|
||||
query: {},
|
||||
packageName: '@angular/router',
|
||||
packageVersion: '4.3.3',
|
||||
|
@ -59,7 +59,7 @@ describe('parsePackageURL', () => {
|
|||
it('parses package names with a period in them', () => {
|
||||
expect(parsePackageURL('/index.js')).toEqual({
|
||||
pathname: '/index.js',
|
||||
search: '',
|
||||
search: null,
|
||||
query: {},
|
||||
packageName: 'index.js',
|
||||
packageVersion: 'latest',
|
||||
|
|
Loading…
Reference in New Issue