Skip to content

Commit

Permalink
move sceenshot to build from test
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Aug 25, 2017
1 parent 0e0b74f commit 29f4ee5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions clean-scripts.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,7 @@ module.exports = {
],
clean: `rimraf demo/**/index.bundle-*.js demo/tree-icon-*.png demo/index.bundle-*.css`
},
`rev-static --config demo/rev-static.config.js`
],
lint: {
ts: `tslint "src/*.ts" "src/*.tsx" "demo/**/*.ts" "demo/**/*.tsx"`,
js: `standard "**/*.config.js"`,
less: `stylelint "src/**/*.less"`,
export: `no-unused-export "src/**/*.ts" "src/**/*.tsx" "demo/**/*.ts" "demo/**/*.tsx" "src/**/*.less" --exclude "src/compiled/**/*"`
},
test: [
'tsc -p spec',
process.env.APPVEYOR ? 'echo "skip karma test"' : 'karma start spec/karma.config.js',
`rev-static --config demo/rev-static.config.js`,
async () => {
const { createServer } = require('http-server')
const puppeteer = require('puppeteer')
Expand All @@ -44,12 +34,24 @@ module.exports = {
const page = await browser.newPage()
for (const type of ['vue', 'react', 'angular']) {
await page.goto(`http://localhost:8000/demo/${type}`)
const buffer = await page.screenshot({ path: `spec/${type}.png`, fullPage: true })
console.log(`data:image/png;base64,${buffer.toString('base64')}`)
await page.screenshot({ path: `demo/${type}/screenshot.png`, fullPage: true })
}
server.close()
browser.close()
},
}
],
lint: {
ts: `tslint "src/*.ts" "src/*.tsx" "demo/**/*.ts" "demo/**/*.tsx"`,
js: `standard "**/*.config.js"`,
less: `stylelint "src/**/*.less"`,
export: `no-unused-export "src/**/*.ts" "src/**/*.tsx" "demo/**/*.ts" "demo/**/*.tsx" "src/**/*.less" --exclude "src/compiled/**/*"`
},
test: [
'tsc -p spec',
process.env.APPVEYOR ? 'echo "skip karma test"' : 'karma start spec/karma.config.js',
'git checkout demo/vue/screenshot.png',
'git checkout demo/react/screenshot.png',
'git checkout demo/angular/screenshot.png',
() => new Promise((resolve, reject) => {
childProcess.exec('git status -s', (error, stdout, stderr) => {
if (error) {
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 29f4ee5

Please sign in to comment.