Skip to content

Commit 66cfbab

Browse files
committed
save work
1 parent 5a90bb9 commit 66cfbab

File tree

3 files changed

+29
-33
lines changed

3 files changed

+29
-33
lines changed

package-lock.json

Lines changed: 10 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ test('it fetches css from a page with CSS in server generated <style> inside the
5656
t.is(actual, expected)
5757
})
5858

59+
test('it finds server generated inline css', async t => {
60+
const url = '/server-inline-css'
61+
server.get(url, (req, res) => {
62+
res.send(`
63+
<!doctype html>
64+
<div style="color: red;">inline style</div>
65+
`)
66+
})
67+
68+
const actual = await extractCss(server.url + url)
69+
const expected = `color: red;`
70+
71+
t.true(
72+
actual.includes(expected),
73+
`'${actual}' does not include the CSS string '${expected}'`
74+
)
75+
})
76+
5977
test('it finds JS generated <link /> CSS', async t => {
6078
const path = '/js-generated-link'
6179
const cssInJsExampleHtml = readFileSync(

test/kitchen-sink.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<h1>Title</h1>
1818
<div class="server-style">server-style:</div>
19+
<div style="outline: 1px solid red;">inline style</div>
1920

2021
<script>
2122
// Client generated style

0 commit comments

Comments
 (0)