Skip to content

Commit bdd7b97

Browse files
committed
feat: Add tests for keys in transport object in broccoli-css-blocks.
1 parent a31a6d3 commit bdd7b97

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/broccoli-css-blocks/test/plugin-test.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("Broccoli Plugin Test", function() {
2020
assert.ok(1);
2121
});
2222

23-
it("outputs CSS file", async () => {
23+
it("outputs CSS file and populates transport object", async () => {
2424
const entryComponentName = "Chrisrng";
2525

2626
input.write({
@@ -46,18 +46,25 @@ describe("Broccoli Plugin Test", function() {
4646
});
4747

4848
let analyzer = new GlimmerAnalyzer(input.path());
49+
let transport = {};
4950

5051
let compiler = new BroccoliCSSBlocks(input.path(), {
5152
entry: [entryComponentName],
5253
output: "src/ui/styles/css-blocks.css",
53-
transport: {},
54+
transport,
5455
analyzer,
5556
});
5657

5758
let output = await buildOutput(compiler);
5859
let files = output.read();
5960

60-
assert.ok(files["src"]!["ui"]["styles"]["css-blocks.css"]);
61+
assert.ok(Object.keys(transport).length, "Transport Object populated");
62+
assert.ok(transport["mapping"], "Mapping property is populated in Transport Object");
63+
assert.ok(transport["blocks"], "Blocks property is populated in Transport Object");
64+
assert.ok(transport["analyzer"], "Analyzer property is populated in Transport Object");
65+
assert.ok(transport["css"], "CSS property is populated in Transport Object");
66+
67+
assert.ok(files["src"]!["ui"]["styles"]["css-blocks.css"], "CSS File generated");
6168
});
6269
});
6370
});

0 commit comments

Comments
 (0)