Skip to content

Commit

Permalink
Remove versions key in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Jun 24, 2024
1 parent f6661cd commit f69f739
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions tests/plugins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import { format, no, pluginPath, t, yes } from './utils.js'
const require = createRequire(import.meta.url)

interface PluginTest {
versions: number[]
plugins: string[]
options?: Record<string, any>
tests: Record<string, TestEntry[]>
}

let tests: PluginTest[] = [
{
versions: [2, 3],
plugins: ['@trivago/prettier-plugin-sort-imports'],
options: {
importOrder: ['^@one/(.*)$', '^@two/(.*)$', '^[./]'],
Expand Down Expand Up @@ -44,7 +42,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [2, 3],
plugins: ['@ianvs/prettier-plugin-sort-imports'],
options: {
importOrder: ['^@tailwindcss/(.*)$', '^@babel/(.*)$', '^[./]'],
Expand Down Expand Up @@ -74,7 +71,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [3],
plugins: ['prettier-plugin-sort-imports'],
options: {
sortingMethod: 'alphabetical',
Expand Down Expand Up @@ -103,7 +99,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [3],
plugins: ['prettier-plugin-multiline-arrays'],
tests: {
babel: [[`const array = [\n'one']`, `const array = [\n 'one',\n]`]],
Expand All @@ -112,7 +107,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [2, 3],
plugins: ['prettier-plugin-organize-imports'],
options: {},
tests: {
Expand All @@ -137,7 +131,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [3],
plugins: ['@zackad/prettier-plugin-twig-melody'],
options: {
twigAlwaysBreakObjects: false,
Expand Down Expand Up @@ -172,7 +165,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [2, 3],
plugins: ['@prettier/plugin-pug'],
tests: {
pug: [
Expand Down Expand Up @@ -206,7 +198,6 @@ let tests: PluginTest[] = [
},
{
// NOTE: This plugin doesn't officially support Prettier v3 but it seems to work fine
versions: [2, 3],
plugins: ['prettier-plugin-import-sort'],
tests: {
babel: [
Expand All @@ -223,7 +214,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [2, 3],
plugins: ['prettier-plugin-jsdoc'],
tests: {
babel: [
Expand All @@ -235,7 +225,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [2, 3],
plugins: ['prettier-plugin-css-order'],
tests: {
css: [
Expand All @@ -248,7 +237,6 @@ let tests: PluginTest[] = [
},
{
// NOTE: This plugin doesn't officially support Prettier v3 but it appears to work
versions: [2, 3],
plugins: ['prettier-plugin-style-order'],
tests: {
css: [
Expand All @@ -260,7 +248,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [2, 3],
plugins: ['prettier-plugin-organize-attributes'],
tests: {
html: [
Expand All @@ -272,7 +259,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [2, 3],
plugins: ['@shopify/prettier-plugin-liquid'],
tests: {
'liquid-html': [
Expand Down Expand Up @@ -306,7 +292,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [3],
plugins: ['prettier-plugin-marko'],
tests: {
marko: [
Expand Down Expand Up @@ -350,7 +335,6 @@ let tests: PluginTest[] = [
},
},
{
versions: [2, 3],
plugins: ['prettier-plugin-astro'],
tests: {
astro: [
Expand Down Expand Up @@ -402,7 +386,6 @@ import Custom from '../components/Custom.astro'
},
},
{
versions: [2, 3],
plugins: ['prettier-plugin-svelte'],
tests: {
svelte: [
Expand Down Expand Up @@ -460,14 +443,7 @@ import Custom from '../components/Custom.astro'
for (const group of tests) {
let name = group.plugins.join(', ')

let canRun = group.versions.includes(3)

for (let parser in group.tests) {
if (!canRun) {
test.todo(`parsing ${parser} works with: ${name}`)
continue
}

test(`parsing ${parser} works with: ${name}`, async ({ expect }) => {
// Hide logs from Pug's prettier plugin
if (parser === 'pug') {
Expand Down

0 comments on commit f69f739

Please sign in to comment.