Skip to content

Commit 766c007

Browse files
committed
Remove import/export usage in tests; since ava no longer includes Babel
1 parent 9fc2deb commit 766c007

File tree

21 files changed

+93
-93
lines changed

21 files changed

+93
-93
lines changed

test/base.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import test from 'ava'
2-
import path from 'path'
1+
const test = require('ava')
2+
const path = require('path')
33

4-
import cli from './helpers/cli.js'
5-
import tmp from './helpers/tmp.js'
6-
import read from './helpers/read.js'
4+
const cli = require('./helpers/cli.js')
5+
const tmp = require('./helpers/tmp.js')
6+
const read = require('./helpers/read.js')
77

88
test('--base --dir works', async t => {
99
const dir = tmp()

test/cli.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import test from 'ava'
1+
const test = require('ava')
22

3-
import cli from './helpers/cli.js'
4-
import tmp from './helpers/tmp.js'
5-
import read from './helpers/read.js'
3+
const cli = require('./helpers/cli.js')
4+
const tmp = require('./helpers/tmp.js')
5+
const read = require('./helpers/read.js')
66

77
test('works with defaults', async t => {
88
const output = tmp('output.css')

test/config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import test from 'ava'
2-
import path from 'path'
1+
const test = require('ava')
2+
const path = require('path')
33

4-
import ENV from './helpers/env.js'
4+
const ENV = require('./helpers/env.js')
55

6-
import cli from './helpers/cli.js'
7-
import read from './helpers/read.js'
6+
const cli = require('./helpers/cli.js')
7+
const read = require('./helpers/read.js')
88

99
test('supports common config', async t => {
1010
const env = `module.exports = {

test/dir.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import test from 'ava'
2-
import path from 'path'
1+
const test = require('ava')
2+
const path = require('path')
33

4-
import cli from './helpers/cli.js'
5-
import tmp from './helpers/tmp.js'
6-
import read from './helpers/read.js'
4+
const cli = require('./helpers/cli.js')
5+
const tmp = require('./helpers/tmp.js')
6+
const read = require('./helpers/read.js')
77

88
test('--dir works', async t => {
99
const dir = tmp()

test/error.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import test from 'ava'
1+
const test = require('ava')
22

3-
import tmp from './helpers/tmp.js'
4-
import cli from './helpers/cli.js'
3+
const tmp = require('./helpers/tmp.js')
4+
const cli = require('./helpers/cli.js')
55

66
test('multiple input files && --output', t => {
77
return cli(['test/fixtures/*.css', '-o', tmp()]).then(({ error, code }) => {

test/ext.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import test from 'ava'
1+
const test = require('ava')
22

3-
import fs from 'fs-extra'
4-
import path from 'path'
3+
const fs = require('fs-extra')
4+
const path = require('path')
55

6-
import cli from './helpers/cli.js'
7-
import tmp from './helpers/tmp.js'
6+
const cli = require('./helpers/cli.js')
7+
const tmp = require('./helpers/tmp.js')
88

99
test('--ext works', async t => {
1010
const dir = tmp()

test/glob.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import test from 'ava'
2-
import path from 'path'
1+
const test = require('ava')
2+
const path = require('path')
33

4-
import cli from './helpers/cli.js'
5-
import tmp from './helpers/tmp.js'
6-
import read from './helpers/read.js'
4+
const cli = require('./helpers/cli.js')
5+
const tmp = require('./helpers/tmp.js')
6+
const read = require('./helpers/read.js')
77

88
test('works with glob patterns', async t => {
99
const output = tmp()

test/helpers/cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import path from 'path'
2-
import { exec } from 'child_process'
1+
const path = require('path')
2+
const { exec } = require('child_process')
33

4-
export default function(args, cwd) {
4+
module.exports = function(args, cwd) {
55
return new Promise(resolve => {
66
exec(
77
`node ${path.resolve('bin/postcss')} ${args.join(' ')}`,

test/helpers/env.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import fs from 'fs-extra'
2-
import path from 'path'
3-
import globby from 'globby'
1+
const fs = require('fs-extra')
2+
const path = require('path')
3+
const globby = require('globby')
44

5-
import tmp from './tmp.js'
5+
const tmp = require('./tmp.js')
66

7-
export default function(config, fixtures) {
7+
module.exports = function(config, fixtures) {
88
fixtures = fixtures || '**/*'
99
const dir = tmp()
1010

test/helpers/read.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { readFile } from 'fs-extra'
1+
const { readFile } = require('fs-extra')
22

3-
export default function(path) {
3+
module.exports = function(path) {
44
return readFile(path, 'utf8').then(content => content.replace(/\r\n/g, '\n')) // normalize line endings on Windows
55
}

0 commit comments

Comments
 (0)