-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from iambumblehead/resolve-pg-pattern
resolve pg main: ./lib definition
- Loading branch information
Showing
5 changed files
with
20 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "resolvewithplus", | ||
"version": "0.8.8", | ||
"version": "0.8.9", | ||
"engines" : { | ||
"node" : ">=12.16.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// Timestamp: 2017.04.23-23:31:33 (last modified) | ||
// Author(s): bumblehead <[email protected]> | ||
|
||
import url, { fileURLToPath } from 'url'; | ||
import url from 'url'; | ||
import os from 'os'; | ||
import path from 'path'; | ||
import test from 'node:test' | ||
|
@@ -18,7 +18,7 @@ test('should convert win32 path to node-friendly posix path', () => { | |
}) | ||
|
||
test('should pass windows and posix system-specific module path', () => { | ||
const modulePath = fileURLToPath( | ||
const modulePath = url.fileURLToPath( | ||
new URL('../testfiles/testscript.js', import.meta.url)) | ||
const calleePath = import.meta.url; | ||
const returnPath = resolvewithplus(modulePath, calleePath) | ||
|
@@ -150,6 +150,14 @@ test('should handle package.json stringy "exports" field (got)', () => { | |
path.resolve('../node_modules/got/dist/source/index.js')); | ||
}); | ||
|
||
test('should handle package.json "main": "./lib" field (pg)', () => { | ||
const fullpath = path.resolve('../testfiles/'); | ||
|
||
assert.strictEqual( | ||
resolvewithplus('pg', fullpath), | ||
path.resolve('../node_modules/pg/lib/index.js')); | ||
}); | ||
|
||
test('should return values from cache', () => { | ||
resolvewithplus.cache['filepathkey'] = 'filepathvalue'; | ||
|
||
|