UNPKG

330 BJavaScriptView Raw
1var test = require('ava')
2var getCss = require('..')
3
4var css = 'h1 { color: tomato; }'
5var html = '<style>' + css + '</style><h1>Hello, world!</h1>'
6
7test('should correctly extract css from raw html', async (t) => {
8 t.plan(1)
9
10 const result = await getCss('http://example.com/', null, html)
11
12 t.deepEqual(css, result.css)
13})