UNPKG

744 BJavaScriptView Raw
1/**
2 * Test case for takeCapture.
3 * Runs with mocha.
4 */
5'use strict'
6
7const takeCapture = require('../lib/take_capture.js')
8const assert = require('assert')
9const fs = require('fs')
10const co = require('co')
11
12describe('take-capture', function () {
13 this.timeout(80000)
14 before(() => co(function * () {
15
16 }))
17
18 after(() => co(function * () {
19
20 }))
21
22 it('Take capture', () => co(function * () {
23 yield takeCapture(
24 `${__dirname}/../doc/mocks/mock-html.html`,
25 `${__dirname}/../tmp/testing-capture.png`,
26 {
27 selector: 'h1',
28 width: 1280,
29 height: 320
30 }
31 )
32 assert.ok(
33 fs.existsSync(`${__dirname}/../tmp/testing-capture.png`)
34 )
35 }))
36})
37
38/* global describe, before, after, it */