Skip to content

Commit

Permalink
Test external CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Oct 15, 2015
1 parent 10edc04 commit 9406b5e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 1 deletion.
1 change: 1 addition & 0 deletions fixture/external-css/README.md
@@ -0,0 +1 @@
# Hello
3 changes: 3 additions & 0 deletions fixture/external-css/docpress.json
@@ -0,0 +1,3 @@
{
"css": [ "http://site.com/external.css" ]
}
9 changes: 9 additions & 0 deletions fixture/external-css/metalsmith.js
@@ -0,0 +1,9 @@
var app = require('docpress-core/ms')(__dirname)
.use(require('docpress-core')())
.use(require('../../')())

if (module.parent) {
module.exports = app
} else {
app.build(function (err) { if (err) throw err })
}
Empty file.
28 changes: 28 additions & 0 deletions test/fixture/external_css_test.js
@@ -0,0 +1,28 @@
'use strict'

const fixture = require('../support/fixture')

describe('fixture/external-css:', function () {
this.timeout(10000)

let app, data
let fx = fixture('external-css')

before(function (done) {
app = require(fx.path('metalsmith.js'))
app.build((err) => {
if (err) return done(err)
done()
})
})

describe('index.html', function () {
before(function () {
data = fx.read('_docpress/index.html').toLowerCase()
})

it('renders external css', function () {
expect(data).toInclude('<link rel="stylesheet" href="http://site.com/external.css">')
})
})
})
2 changes: 1 addition & 1 deletion test/fixture/onmount_test.js
Expand Up @@ -2,7 +2,7 @@

const fixture = require('../support/fixture')

describe('fixture', function () {
describe('fixture/onmount:', function () {
this.timeout(10000)

let app, data
Expand Down

0 comments on commit 9406b5e

Please sign in to comment.