Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit 151be44

Browse files
committed
Remove workaround by using current test name
1 parent 2964d86 commit 151be44

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

tests/10-apply.test.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ const fs = require('fs')
44
const path = require('path')
55

66
function run(input, config = {}) {
7-
return postcss([tailwind(config)]).process(input, { from: path.resolve(__filename) })
7+
const { currentTestName } = expect.getState()
8+
9+
return postcss([tailwind(config)]).process(input, {
10+
from: `${path.resolve(__filename)}?test=${currentTestName}`
11+
})
812
}
913

1014
test('@apply', () => {
@@ -141,9 +145,6 @@ test('@apply', () => {
141145

142146
test('@apply error with unknown utility', async () => {
143147
let config = {
144-
// TODO: Remove this. Some kind of caching causes multiple tests in the same file to break.
145-
__name: "unknown-utility",
146-
147148
darkMode: 'class',
148149
purge: [path.resolve(__dirname, './10-apply.test.html')],
149150
corePlugins: { preflight: false },
@@ -166,9 +167,6 @@ test('@apply error with unknown utility', async () => {
166167

167168
test('@apply error with nested @screen', async () => {
168169
let config = {
169-
// TODO: Remove this. Some kind of caching causes multiple tests in the same file to break.
170-
__name: "at-screen",
171-
172170
darkMode: 'class',
173171
purge: [path.resolve(__dirname, './10-apply.test.html')],
174172
corePlugins: { preflight: false },
@@ -193,9 +191,6 @@ test('@apply error with nested @screen', async () => {
193191

194192
test('@apply error with nested @anyatrulehere', async () => {
195193
let config = {
196-
// TODO: Remove this. Some kind of caching causes multiple tests in the same file to break.
197-
__name: "at-anything",
198-
199194
darkMode: 'class',
200195
purge: [path.resolve(__dirname, './10-apply.test.html')],
201196
corePlugins: { preflight: false },

0 commit comments

Comments
 (0)