From 12857ddf051cdf518badcac75193025d3b09daba Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Sat, 15 Sep 2018 08:26:24 -0400 Subject: [PATCH] Test no prefix apply with function prefix --- __tests__/applyAtRule.test.js | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/__tests__/applyAtRule.test.js b/__tests__/applyAtRule.test.js index 631082985..18dad88ad 100644 --- a/__tests__/applyAtRule.test.js +++ b/__tests__/applyAtRule.test.js @@ -217,28 +217,28 @@ test('you can apply utility classes without using the given prefix', () => { }) }) -// test('you can apply utility classes without using the given prefix when using a function for the prefix', () => { -// const input = ` -// .foo { @apply .tw-mt-4 .mb-4; } -// ` +test('you can apply utility classes without using the given prefix when using a function for the prefix', () => { + const input = ` + .foo { @apply .tw-mt-4 .mb-4; } + ` -// const expected = ` -// .foo { margin-top: 1rem; margin-bottom: 1rem; } -// ` + const expected = ` + .foo { margin-top: 1rem; margin-bottom: 1rem; } + ` -// const config = { -// ...defaultConfig, -// options: { -// ...defaultConfig.options, -// prefix: selector => { -// return 'tw-' -// }, -// }, -// experiments: { shadowLookup: true }, -// } + const config = { + ...defaultConfig, + options: { + ...defaultConfig.options, + prefix: () => { + return 'tw-' + }, + }, + experiments: { shadowLookup: true }, + } -// return run(input, config, generateUtilities(config, [])).then(result => { -// expect(result.css).toEqual(expected) -// expect(result.warnings().length).toBe(0) -// }) -// }) + return run(input, config, generateUtilities(config, [])).then(result => { + expect(result.css).toEqual(expected) + expect(result.warnings().length).toBe(0) + }) +})