Skip to content

Commit

Permalink
Move the helpers in to a directory, so they aren't confused with top-…
Browse files Browse the repository at this point in the history
…level config
  • Loading branch information
NullVoxPopuli committed Jul 17, 2023
1 parent aa1bb47 commit 387847b
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 16 deletions.
4 changes: 4 additions & 0 deletions tests/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './helpers/assertions.js';
export * from './helpers/fixtures.js';
export * from './helpers/meta-helpers.js';
export * from './helpers/utils.js';
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/fixtures.ts → tests/helpers/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

const fixturesPath = path.join(__dirname, 'fixtures');
const fixturesPath = path.join(__dirname, '../fixtures');

/**
* Returns the contents of a file from the "tests/fixtures" directory.
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions tests/smoke-tests/--addon-location.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ import fs from 'node:fs/promises';
import path from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

import { assertGeneratedCorrectly } from '../assertions.js';
import { createAddon, createTmp, install, runScript } from '../utils.js';
import {
assertGeneratedCorrectly,
createAddon,
createTmp,
install,
runScript,
} from '../helpers.js';

describe('--addon-location', () => {
let cwd = '';
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke-tests/--addon-only.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fse from 'fs-extra';
import path from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

import { AddonHelper } from '../test-helpers.js';
import { AddonHelper } from '../helpers.js';

describe('--addon-only', () => {
let helper = new AddonHelper({ packageManager: 'pnpm', args: ['--addon-only'] });
Expand Down
9 changes: 7 additions & 2 deletions tests/smoke-tests/--test-app-location.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ import fs from 'node:fs/promises';
import path from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

import { assertGeneratedCorrectly } from '../assertions.js';
import { createAddon, createTmp, install, runScript } from '../utils.js';
import {
assertGeneratedCorrectly,
createAddon,
createTmp,
install,
runScript,
} from '../helpers.js';

describe('--test-app-location', () => {
let cwd = '';
Expand Down
4 changes: 2 additions & 2 deletions tests/smoke-tests/--typescript.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import fs from 'node:fs/promises';
import path from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

import { assertGeneratedCorrectly } from '../assertions.js';
import {
assertGeneratedCorrectly,
createAddon,
createTmp,
dirContents,
install,
runScript,
SUPPORTED_PACKAGE_MANAGERS,
} from '../utils.js';
} from '../helpers.js';

for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
describe(`--typescript with ${packageManager}`, () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/smoke-tests/defaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import fs from 'node:fs/promises';
import path from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

import { assertGeneratedCorrectly } from '../assertions.js';
import {
assertGeneratedCorrectly,
createAddon,
createTmp,
dirContents,
install,
runScript,
SUPPORTED_PACKAGE_MANAGERS,
} from '../utils.js';
} from '../helpers.js';

for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
describe(`defaults with ${packageManager}`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ import fs from 'node:fs/promises';
import path from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

import { assertGeneratedCorrectly } from '../../assertions.js';
import { readFixture } from '../../fixtures.js';
import { createAddon, createTmp, install, runScript } from '../../utils.js';
import {
assertGeneratedCorrectly,
createAddon,
createTmp,
install,
readFixture,
runScript,
} from '../../helpers.js';

let commonFixtures = {
'.prettierrc.js': await readFixture('.prettierrc.js'),
Expand Down
6 changes: 3 additions & 3 deletions tests/smoke-tests/within-existing-monorepo/defaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import fs from 'node:fs/promises';
import path from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

import { assertGeneratedCorrectly } from '../../assertions.js';
import { readFixture } from '../../fixtures.js';
import {
assertGeneratedCorrectly,
createAddon,
createTmp,
install,
readFixture,
runScript,
SUPPORTED_PACKAGE_MANAGERS,
} from '../../utils.js';
} from '../../helpers.js';

let commonFixtures = {
'.prettierrc.js': await readFixture('.prettierrc.js'),
Expand Down

0 comments on commit 387847b

Please sign in to comment.