-
Notifications
You must be signed in to change notification settings - Fork 27
/
test.js
32 lines (26 loc) · 995 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { before, after, describe, it } = require('kocha')
const { expect } = require('chai')
const { execSync } = require('child_process')
const { readFileSync } = require('fs')
const { join } = require('path')
const rimraf = require('rimraf')
before(done => {
rimraf('examples/*/build', done)
})
after(done => {
rimraf('examples/*/build', done)
})
describe('remarker', () => {
it('creates index.html from slides.md', () => {
execSync('node ../../index.js build', {
cwd: join(__dirname, 'examples/simple')
})
expect(readFileSync(join(__dirname, 'examples/simple/build/index.html')).toString()).to.include('My Awesome Presentation')
})
it('reads remarker.yml if it exists in cwd', () => {
execSync('node ../../index.js build', {
cwd: join(__dirname, 'examples/remark')
})
expect(readFileSync(join(__dirname, 'examples/remark/build/index.html')).toString()).to.include('@import url(https://fonts.googleapis.com/css?family=Droid+Serif);')
})
})