Skip to content

Commit 25ed8fe

Browse files
committed
test fixes
1 parent d07e74e commit 25ed8fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/test-hook.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use strict';
22

3-
import '../src';
43
import fs from 'fs'
54
import path from 'path'
65
import { equal } from 'assert';
76

7+
import hook from '../src';
8+
89
const pipelines = {
910
'test-cases': undefined,
1011
'cssi': []
@@ -16,7 +17,8 @@ Object.keys(pipelines).forEach(dirname => {
1617

1718
fs.readdirSync(testDir).forEach(testCase => {
1819
if (fs.existsSync(path.join(testDir, testCase, 'source.css'))) {
19-
it('should ' + testCase.replace(/-/g, ' '), done => {
20+
it('should ' + testCase.replace(/-/g, ' '), () => {
21+
hook({use: pipelines[dirname]});
2022
let expectedTokens = JSON.parse(fs.readFileSync(path.join(testDir, testCase, 'expected.json'), 'utf-8'));
2123
let tokens = require(`${testDir}/${testCase}/source.css`);
2224

@@ -34,7 +36,8 @@ describe( 'multiple sources', () => {
3436
let dirname = 'test-cases';
3537

3638
if (fs.existsSync(path.join(testDir, testCase, 'source1.css'))) {
37-
it('should ' + testCase.replace(/-/g, ' '), done => {
39+
it('should ' + testCase.replace(/-/g, ' '), () => {
40+
hook({use: pipelines[dirname]});
3841
let expectedTokens = JSON.parse(fs.readFileSync(path.join(testDir, testCase, 'expected.json'), 'utf-8'));
3942
let tokens1 = require(`${testDir}/${testCase}/source1.css`);
4043
let tokens2 = require(`${testDir}/${testCase}/source2.css`);

0 commit comments

Comments
 (0)