mirror of
https://github.com/c8r/x0.git
synced 2024-08-17 01:10:32 +03:00
Try rimraf in tests
This commit is contained in:
parent
651187876c
commit
47844673d2
@ -61,6 +61,7 @@
|
||||
"nyc": "^11.8.0",
|
||||
"rebass": "^2.0.0-2",
|
||||
"refunk": "^2.2.4",
|
||||
"rimraf": "^2.6.2",
|
||||
"styled-components": "^3.2.6",
|
||||
"styled-system": "^2.2.5"
|
||||
},
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from 'fs-extra'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import test from 'ava'
|
||||
import rimraf from 'rimraf'
|
||||
import build from '../lib/build'
|
||||
|
||||
const input = path.resolve('test/components')
|
||||
@ -16,7 +17,10 @@ const options = {
|
||||
}
|
||||
|
||||
const clean = () => {
|
||||
fs.remove(output)
|
||||
if (fs.existsSync(output)) {
|
||||
rimraf.sync(output)
|
||||
}
|
||||
// fs.remove(output)
|
||||
}
|
||||
|
||||
test.before(clean)
|
||||
@ -35,7 +39,8 @@ test('static uses getInitialProps method', async t => {
|
||||
})
|
||||
|
||||
test('static makes a directory', async t => {
|
||||
fs.remove(output)
|
||||
// fs.remove(output)
|
||||
clean()
|
||||
const res = await build(options)
|
||||
t.pass()
|
||||
})
|
||||
|
@ -8,10 +8,10 @@ Generated by [AVA](https://ava.li).
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
'<!DOCTYPE html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="generator" content="Compositor x0"><title>x0</title><style>*{box-sizing:border-box}body{margin:0;font-family:system-ui,sans-serif}</style></head><div id="root"><h1>Hello</h1></div><script src="bundle.js"></script>'
|
||||
'<!DOCTYPE html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="generator" content="Compositor x0"><title>x0</title><style>*{box-sizing:border-box}body{margin:0;font-family:system-ui,sans-serif}</style></head><div id="root"><h1>Hello</h1></div><script src="/bundle.js"></script>'
|
||||
|
||||
## static uses getInitialProps method
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
'<!DOCTYPE html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="generator" content="Compositor x0"><title>x0</title><style>*{box-sizing:border-box}body{margin:0;font-family:system-ui,sans-serif}</style></head><div id="root"><h1>Hello</h1></div><script src="bundle.js"></script>'
|
||||
'<!DOCTYPE html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="generator" content="Compositor x0"><title>x0</title><style>*{box-sizing:border-box}body{margin:0;font-family:system-ui,sans-serif}</style></head><div id="root"><h1>Hello</h1></div><script src="/bundle.js"></script>'
|
||||
|
Binary file not shown.
@ -21,7 +21,7 @@ Generated by [AVA](https://ava.li).
|
||||
</head>␊
|
||||
<div id=root>hello</div>␊
|
||||
<script>console.log("beep")</script>␊
|
||||
|
||||
`
|
||||
|
||||
## template static snapshot
|
||||
|
||||
@ -40,4 +40,4 @@ Generated by [AVA](https://ava.li).
|
||||
</head>␊
|
||||
<div id=root>hello</div>␊
|
||||
␊
|
||||
`
|
||||
`
|
||||
|
Loading…
Reference in New Issue
Block a user