Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .config/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import path from 'node:path';

export default defineConfig({
test: {
globals: true,
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)', 'test/test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
// Store snapshots next to each test in a .snapshots folder
resolveSnapshotPath: (testPath, snapExt) =>
path.join(path.dirname(testPath), '.snapshots', path.basename(testPath) + snapExt)
Expand Down
4 changes: 2 additions & 2 deletions packages/beep/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "ava --verbose",
"ci:test": "pnpm test -- --reporter=verbose",
"release": "pnpm --workspace-root package:release $(pwd)",
"test": "ava"
"test": "vitest --config ../../.config/vitest.config.mts run"
},
"files": [
"lib/",
Expand Down
7 changes: 7 additions & 0 deletions packages/beep/test/.snapshots/test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`pass 1`] = `
"
fixtures/pass.js → output/bundle.js...
created output/bundle.js in <time>ms"
`;
3 changes: 2 additions & 1 deletion packages/beep/test/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const test = require('ava');
const execa = require('execa');

const test = require('../../../util/vitest-ava-compat');

const options = { cwd: __dirname };

test('pass', async (t) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/buble/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm build && pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm test -- --verbose",
"ci:test": "pnpm test -- --reporter=verbose",
"prebuild": "del-cli dist",
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
"prerelease": "pnpm build",
"pretest": "pnpm build",
"release": "pnpm --workspace-root package:release $(pwd)",
"test": "ava",
"test": "vitest --config ../../.config/vitest.config.mts run",
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
},
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/buble/test/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const test = require('ava');
const rollup = require('rollup');

const test = require('../../../util/vitest-ava-compat');

const buble = require('..');

process.chdir(__dirname);
Expand Down
4 changes: 2 additions & 2 deletions packages/data-uri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm build && pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm test -- --verbose",
"ci:test": "pnpm test -- --reporter=verbose",
"prebuild": "del-cli dist",
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
"prerelease": "pnpm build",
"pretest": "pnpm build --sourcemap",
"release": "pnpm --workspace-root package:release $(pwd)",
"test": "ava",
"test": "vitest --config ../../.config/vitest.config.mts run",
"test:ts": "tsc --noEmit"
},
"files": [
Expand Down
79 changes: 79 additions & 0 deletions packages/data-uri/test/.snapshots/test.mjs.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`bad json 1`] = `
{
"code": "PLUGIN_ERROR",
"plugin": "dataUri",
"pluginCode": "DU$JSON",
}
`;

exports[`base64 1`] = `
{
"batman": "true",
}
`;

exports[`base64 2`] = `
"'use strict';

const batman = "true";
var batman$1 = {
batman: batman
};

t.truthy(batman$1.batman);
t.snapshot(batman$1);
"
`;

exports[`import 1`] = `true`;

exports[`import 2`] = `
"'use strict';

t.truthy(true);

const batman = true;

t.snapshot(batman);
"
`;

exports[`json 1`] = `
{
"batman": "true",
}
`;

exports[`json 2`] = `
"'use strict';

const batman = "true";
var batman$1 = {
batman: batman
};

t.truthy(batman$1.batman);
t.snapshot(batman$1);
"
`;

exports[`works as CJS plugin 1`] = `
{
"batman": "true",
}
`;

exports[`works as CJS plugin 2`] = `
"'use strict';

const batman = "true";
var batman$1 = {
batman: batman
};

t.truthy(batman$1.batman);
t.snapshot(batman$1);
"
`;
2 changes: 1 addition & 1 deletion packages/data-uri/test/test.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createRequire } from 'module';
import { fileURLToPath } from 'url';

import test from 'ava';
import test from '../../../util/vitest-ava-compat.js';

Check warning on line 4 in packages/data-uri/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

`../../../util/vitest-ava-compat.js` import should occur after import of `current-package`

Check warning on line 4 in packages/data-uri/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

There should be at least one empty line between import groups
import { rollup } from 'rollup';

Check failure on line 5 in packages/data-uri/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

Absolute imports should come before relative imports

import dataUri from 'current-package';

Check failure on line 7 in packages/data-uri/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

Absolute imports should come before relative imports

import { testBundle } from '../../../util/test.js';

Expand Down
4 changes: 2 additions & 2 deletions packages/dsv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm build && pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm test -- --verbose",
"ci:test": "pnpm test -- --reporter=verbose",
"prebuild": "del-cli dist",
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
"prerelease": "pnpm build",
"pretest": "pnpm build",
"release": "pnpm --workspace-root package:release $(pwd)",
"test": "ava"
"test": "vitest --config ../../.config/vitest.config.mts run"
},
"files": [
"dist",
Expand Down
3 changes: 2 additions & 1 deletion packages/dsv/test/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const test = require('ava');
const { rollup } = require('rollup');

const test = require('../../../util/vitest-ava-compat');

const dsv = require('..');

process.chdir(__dirname);
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm build && pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm test -- --verbose",
"ci:test": "pnpm test -- --reporter=verbose",
"prebuild": "del-cli dist",
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
"prerelease": "pnpm build",
"pretest": "pnpm build",
"release": "pnpm --workspace-root package:release $(pwd)",
"test": "ava",
"test": "vitest --config ../../.config/vitest.config.mts run",
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint/test/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import { fileURLToPath } from 'url';

import eslint9 from 'eslint9';
import esmock from 'esmock';

Check warning on line 8 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

There should be at least one empty line between import groups
import test from 'ava';
import test from '../../../util/vitest-ava-compat.js';

Check warning on line 9 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

`../../../util/vitest-ava-compat.js` import should occur after import of `current-package`

Check warning on line 9 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

There should be at least one empty line between import groups
import nodeResolve from '@rollup/plugin-node-resolve';

Check failure on line 10 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

Absolute imports should come before relative imports
import { rollup } from 'rollup';

Check failure on line 11 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

Absolute imports should come before relative imports

import eslint from 'current-package';

Check failure on line 13 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

Absolute imports should come before relative imports

test('should lint files', async (t) => {
let count = 0;
Expand Down Expand Up @@ -248,7 +248,7 @@

test.serial('works with ESLint v9', async (t) => {
// Load the plugin with an override to route 'eslint' imports to ESLint v9
const eslint = await esmock('current-package', {

Check warning on line 251 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

'eslint' is already declared in the upper scope on line 13 column 8
eslint: eslint9
});

Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm build && pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm test -- --verbose && pnpm test:ts",
"ci:test": "pnpm test -- --reporter=verbose && pnpm test:ts",
"lint:graphql": "prettier --write \"test/fixtures/**/*.graphql\"",
"prebuild": "del-cli dist && pnpm lint:graphql",
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
"prerelease": "pnpm build",
"pretest": "pnpm build",
"release": "pnpm --workspace-root package:release $(pwd)",
"test": "ava",
"test": "vitest --config ../../.config/vitest.config.mts run",
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
},
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/graphql/test/test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const test = require('ava');
const { rollup } = require('rollup');

const graphql = require('current-package');

const test = require('../../../util/vitest-ava-compat');

const { testBundle } = require('../../../util/test');

require('source-map-support').install();
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/test/test.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fileURLToPath } from 'url';

import test from 'ava';
import test from '../../../util/vitest-ava-compat.js';
import { rollup } from 'rollup';

Check failure on line 4 in packages/graphql/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

Absolute imports should come before relative imports

import graphql from 'current-package';

Check failure on line 6 in packages/graphql/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v24

Absolute imports should come before relative imports

import { testBundle } from '../../../util/test.js';

Expand Down
4 changes: 2 additions & 2 deletions packages/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm build && pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm test -- --verbose",
"ci:test": "pnpm test -- --reporter=verbose",
"prebuild": "del-cli dist",
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
"prerelease": "pnpm build",
"pretest": "pnpm build",
"release": "pnpm --workspace-root package:release $(pwd)",
"test": "ava"
"test": "vitest --config ../../.config/vitest.config.mts run"
},
"files": [
"dist",
Expand Down
Loading
Loading