Skip to content

Commit

Permalink
Un-hoist some packages, clean up lockfile after sku init test
Browse files Browse the repository at this point in the history
  • Loading branch information
askoufis committed May 7, 2024
1 parent 111c591 commit 95e6430
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
7 changes: 0 additions & 7 deletions .npmrc
Expand Up @@ -2,14 +2,7 @@
public-hoist-pattern[]="*eslint*"
public-hoist-pattern[]="*prettier*"

# `sku` itself needs these to be hoisted
public-hoist-pattern[]="babel-loader"
public-hoist-pattern[]="css-loader"

# This is only necessary in this repo because pnpm symlinks the sku dependency in fixtures to the sku package folder directly
# This bypasses the .pnpm folder that resolveModules looks for
# See https://github.com/seek-oss/sku/blob/275752bd3066e52885d461ef5bcd953aaac3bfff/config/webpack/resolveModules.js
public-hoist-pattern[]="@babel/*"

# Ensure that the same TypeScript version used by sku is used by the monorepo
public-hoist-pattern[]="typescript"
20 changes: 17 additions & 3 deletions tests/sku-init.test.js
Expand Up @@ -4,14 +4,28 @@ const { rimraf } = require('rimraf');
const { runSkuScriptInDir } = require('@sku-private/test-utils');

const fixtureDirectory = path.join(__dirname, '../fixtures/sku-init');
const { promisify } = require('node:util');
const exec = promisify(require('node:child_process').exec);

describe('sku init', () => {
const projectName = 'new-project';

beforeAll(async () => {
await rimraf(path.join(fixtureDirectory, projectName));
});

afterAll(async () => {
await rimraf(path.join(fixtureDirectory, projectName));

console.log(
"Running 'pnpm install' to clean lockfile up after sku-init test...",
);
await exec('pnpm install');
});

it(
'should create a sku.config.ts',
async () => {
const projectName = 'new-project';
await rimraf(path.join(fixtureDirectory, projectName));

const { child } = await runSkuScriptInDir('init', fixtureDirectory, [
projectName,
]);
Expand Down

0 comments on commit 95e6430

Please sign in to comment.