1+ const { normalize} = require ( 'path' ) ;
12const { fs : { writeFile, writeJson} } = require ( 'pkg-tests-core' ) ;
23
34module . exports = makeTemporaryEnv => {
45 describe ( `Plug'n'Play API (v1)` , ( ) => {
56 test (
6- `it should expost VERSIONS` ,
7+ `it should expose VERSIONS` ,
78 makeTemporaryEnv ( { } , { plugNPlay : true } , async ( { path, run, source} ) => {
89 await run ( `install` ) ;
910
@@ -12,7 +13,7 @@ module.exports = makeTemporaryEnv => {
1213 ) ;
1314
1415 test (
15- `it should expost resolveToUnqualified` ,
16+ `it should expose resolveToUnqualified` ,
1617 makeTemporaryEnv ( { } , { plugNPlay : true } , async ( { path, run, source} ) => {
1718 await run ( `install` ) ;
1819
@@ -21,7 +22,7 @@ module.exports = makeTemporaryEnv => {
2122 ) ;
2223
2324 test (
24- `it should expost resolveToUnqualified` ,
25+ `it should expose resolveToUnqualified` ,
2526 makeTemporaryEnv ( { } , { plugNPlay : true } , async ( { path, run, source} ) => {
2627 await run ( `install` ) ;
2728
@@ -30,7 +31,7 @@ module.exports = makeTemporaryEnv => {
3031 ) ;
3132
3233 test (
33- `it should expost resolveToUnqualified` ,
34+ `it should expose resolveToUnqualified` ,
3435 makeTemporaryEnv ( { } , { plugNPlay : true } , async ( { path, run, source} ) => {
3536 await run ( `install` ) ;
3637
@@ -39,6 +40,17 @@ module.exports = makeTemporaryEnv => {
3940 ) ;
4041
4142 describe ( `resolveRequest` , ( ) => {
43+ test (
44+ `it should return the path to the PnP file for when 'pnpapi' is requested` ,
45+ makeTemporaryEnv ( { } , { plugNPlay : true } , async ( { path, run, source} ) => {
46+ await run ( `install` ) ;
47+
48+ await expect ( source ( `require('pnpapi').resolveRequest('pnpapi', '${ path } /')` ) ) . resolves . toEqual (
49+ normalize ( `${ path } /.pnp.js` ) ,
50+ ) ;
51+ } ) ,
52+ ) ;
53+
4254 test (
4355 `it should return null for builtins` ,
4456 makeTemporaryEnv ( { } , { plugNPlay : true } , async ( { path, run, source} ) => {
0 commit comments