Skip to content

Commit

Permalink
Adds a test
Browse files Browse the repository at this point in the history
  • Loading branch information
Maël Nison committed Oct 2, 2018
1 parent 9607fb7 commit c598699
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/pkg-tests/pkg-tests-specs/sources/pnp.js
Expand Up @@ -523,7 +523,7 @@ module.exports = makeTemporaryEnv => {
test(
`it should export the PnP API through the 'pnpapi' name`,
makeTemporaryEnv(
{dependencies: {[`no-deps`]: `1.0.0`}},
{},
{
plugNPlay: true,
},
Expand All @@ -535,6 +535,19 @@ module.exports = makeTemporaryEnv => {
),
);

test(
`it should expose the PnP version through 'process.versions.pnp'`,
makeTemporaryEnv({}, {plugNPlay: true}, async ({path, run, source}) => {
await run(`install`);

const pnpapiVersionsStd = await source(`require('pnpapi').VERSIONS.std`);
const processVersionsPnp = await source(`process.versions.pnp`);

await expect(typeof processVersionsPnp).toEqual(`string`);
await expect(processVersionsPnp).toEqual(String(pnpapiVersionsStd));
}),
);

test(
`it should not update the installConfig.pnp field of the package.json when installing with an environment override`,
makeTemporaryEnv(
Expand Down

0 comments on commit c598699

Please sign in to comment.