Skip to content

Commit

Permalink
Added new test for scss (sass)
Browse files Browse the repository at this point in the history
  • Loading branch information
swernerx committed Dec 19, 2018
1 parent 64810da commit 41537fd
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/scss-asset/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SCSS Asset 1`] = `
"bXipeBrs.png
bsdudxaF.md
gToHHcDx.scss
gToHHcDx.scss.map
index.js"
`;

exports[`SCSS Asset 2`] = `
"import content from './bsdudxaF.md';
import scss from './gToHHcDx.scss';
function index() {
return content + scss
}
export default index;
"
`;

exports[`SCSS Asset 3`] = `
"body {
font-size: 20px;
background: url(./bXipeBrs.png) top left repeat;
}
/*# sourceMappingURL=gToHHcDx.scss.map */"
`;
1 change: 1 addition & 0 deletions test/scss-asset/content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Hello
Binary file added test/scss-asset/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions test/scss-asset/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import content from "./content.md"
import scss from "./index.scss"

export default function() {
return content + scss
}
4 changes: 4 additions & 0 deletions test/scss-asset/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
font-size: 20px;
background: url(./image.png) top left repeat;
}
13 changes: 13 additions & 0 deletions test/scss-asset/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { bundle, clean, list, read } from "../util"

const root = __dirname

test("SCSS Asset", async () => {
await bundle(root, "index.js", "output/index.js")

expect(await list(root, "output")).toMatchSnapshot()
expect(await read(root, "output/index.js")).toMatchSnapshot()
expect(await read(root, "output/gToHHcDx.scss")).toMatchSnapshot()

await clean(root, "output")
})

0 comments on commit 41537fd

Please sign in to comment.