Skip to content

Commit

Permalink
Prepare for 0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
winston0410 committed Aug 20, 2021
1 parent be72969 commit 4842136
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 65 deletions.
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

17 changes: 0 additions & 17 deletions benchmark/README.md

This file was deleted.

1 change: 0 additions & 1 deletion benchmark/kit-example
Submodule kit-example deleted from 0bc664
1 change: 0 additions & 1 deletion benchmark/realworld
Submodule realworld deleted from d35ef7
1 change: 0 additions & 1 deletion benchmark/realworld-with-glory
Submodule realworld-with-glory deleted from d35ef7
8 changes: 8 additions & 0 deletions example/src/routes/__layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<style>
.hello{
color: red;
font-size: 12px;
}
</style>

<slot></slot>
36 changes: 0 additions & 36 deletions test/transformer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,3 @@ describe("when transforming html", function () {
);
});
});

describe("when transforming CSS", function () {
const componentCode = `
<style>
.foo{
color: red;
}
</style>
<p class="foo">Hello world<p/>`;

const filename = "/src/index.svelte";

const classCache = {
"/src/__layout.svelte": { bar: { a: true } },
[filename]: { foo: { a: true } },
};

const declarationCache = {
none: { "color:red;": "a" },
};

describe("when identical declaration is found in __layout.svelte", function () {
const ast = parse(componentCode, { filename });
const transformer = createTransformer(componentCode, filename).transformCss(
ast.css,
declarationCache,
classCache,
);

it("should remove that declaration found in current component", async () => {
expect(transformer.toString().replace(/\s/g, "")).toBe(
`<style></style><p class="foo">Hello world<p/>`.replace(/\s/g, "")
);
});
});
});

0 comments on commit 4842136

Please sign in to comment.