Skip to content

Commit

Permalink
full formatting with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Feb 2, 2025
1 parent c1ab98c commit c19c712
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.md
**/*expected.css
**/*expected*.*
packages/cli/test/cases/build.config.optimization-default/src/styles/*.css
packages/cli/test/cases/develop.default.hud-disabled/src/pages/index.html
packages/cli/test/cases/develop.default.hud/src/pages/index.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe("Build Greenwood With: ", function () {
const js = fs.readFileSync(jsFiles[0], "utf-8");

expect(js).to.contain(
"class HeaderComponent extends HTMLElement {\n constructor() {\n super();\n\n this.root = this.attachShadow({ mode: \"open\" });\n this.root.innerHTML = `\n <header>This is the header component.</header>\n `;\n }\n}\n\ncustomElements.define(\"app-header\", HeaderComponent);",
'class HeaderComponent extends HTMLElement {\n constructor() {\n super();\n\n this.root = this.attachShadow({ mode: "open" });\n this.root.innerHTML = `\n <header>This is the header component.</header>\n `;\n }\n}\n\ncustomElements.define("app-header", HeaderComponent);',
);
});

Expand Down Expand Up @@ -111,7 +111,7 @@ describe("Build Greenwood With: ", function () {
const css = fs.readFileSync(cssFiles[0], "utf-8");

expect(css).to.contain(
"{\n margin: 0;\n padding: 0;\n font-family: \"Comic Sans\", sans-serif;\n}",
'{\n margin: 0;\n padding: 0;\n font-family: "Comic Sans", sans-serif;\n}',
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ describe("Develop Greenwood With: ", function () {
});

it("should contain import attributes polyfill syntax for CSS files", function (done) {
expect(text.replace(/ /g, "")).to.contain("importsheetfrom\"./hero.css?polyfill=type-css\"");
expect(text.replace(/ /g, "")).to.contain('importsheetfrom"./hero.css?polyfill=type-css"');
expect(text.replace(/ /g, "")).to.contain(
"importthemefrom\"../theme.css?polyfill=type-css\"",
'importthemefrom"../theme.css?polyfill=type-css"',
);

done();
});

it("should contain import attributes polyfill syntax for JSON", function (done) {
expect(text.replace(/ /g, "")).to.contain("importjsonfrom\"./hero.json?polyfill=type-json\"");
expect(text.replace(/ /g, "")).to.contain('importjsonfrom"./hero.json?polyfill=type-json"');

done();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ describe("Develop Greenwood With: ", function () {
});

it("should return the correct response body", function (done) {
expect(body.replace(/\n/g, '')).to.equal("console.debug(\"its just a prank bro!\");");
expect(body.replace(/\n/g, "")).to.equal('console.debug("its just a prank bro!");');
done();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe("Develop Greenwood With: ", function () {
});

it("should correctly return JavaScript from the developers local files", function (done) {
expect(body).to.contain("customElements.define(\"x-greeting\", GreetingComponent);");
expect(body).to.contain('customElements.define("x-greeting", GreetingComponent);');

done();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ describe("Build Greenwood With: ", function () {
const scriptContents = fs.readFileSync(scripts[0], "utf-8");

expect(scripts.length).to.equal(1);
expect(scriptContents).to.contain(`import e from"/hero.${cssFileHash}.css"with{type:"css"}`);
expect(scriptContents).to.contain(
`import e from"/hero.${cssFileHash}.css"with{type:"css"}`,
);
});

it("should have the expected CSS output bundle for hero.css", function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ describe("Serve Greenwood With: ", function () {
const homePartial = fs.readFileSync(path.join(publicPath, "_routes/index.html"), "utf-8");
const homeRouterOutlet = dom.window.document.querySelectorAll("body > router-outlet")[0];

expect(homeRouterOutlet.innerHTML.replace(/\n/g, '').replace(/ /g, '')).to.contain(homePartial.replace(/\n/g, '').replace(/ /g, ''));
expect(homeRouterOutlet.innerHTML.replace(/\n/g, "").replace(/ /g, "")).to.contain(
homePartial.replace(/\n/g, "").replace(/ /g, ""),
);
});
});

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/test/cases/theme-pack/theme-pack.develop.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe("Develop Greenwood With: ", function () {

it("should correctly return CSS from the developers local files", function (done) {
expect(body).to.equal(
":root{--color-primary:#135;--color-secondary:#74b238;--font-family:\"Optima\", sans-serif;}",
':root{--color-primary:#135;--color-secondary:#74b238;--font-family:"Optima", sans-serif;}',
);

done();
Expand Down Expand Up @@ -156,7 +156,7 @@ describe("Develop Greenwood With: ", function () {
});

it("should correctly return JavaScript from the developers local files", function (done) {
expect(body).to.contain("customElements.define(\"x-header\", HeaderComponent);");
expect(body).to.contain('customElements.define("x-header", HeaderComponent);');

done();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ describe("Build Greenwood With: ", function () {
it("should have the expected logo CSS inlined into the style tag", () => {
const styles = dom.window.document.querySelectorAll("head style");
const styleText = styles[0].textContent;
const expectedStyles =
`.logo-${scopedHash}-container{display:flex}.logo-${scopedHash}-logo{display:inline-block;width:100%;}`;
const expectedStyles = `.logo-${scopedHash}-container{display:flex}.logo-${scopedHash}-logo{display:inline-block;width:100%;}`;

expect(styleText).to.contain(expectedStyles);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ describe("Develop Greenwood With: ", function () {
});

it("should return an ECMASCript module", function () {
expect(data.replace(/\n/g, '')).to.equal("export const styles = `.mdc-touch-target-wrapper{display:inline}`;");
expect(data.replace(/\n/g, "")).to.equal(
"export const styles = `.mdc-touch-target-wrapper{display:inline}`;",
);
});
});
});
Expand Down
7 changes: 5 additions & 2 deletions test/smoke-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ function commonIndexSpecs(dom, html, label) {
const trimmedHtml = html.replace(/<!--*.*-->/, "");

expect(trimmedHtml).to.satisfy(function () {
return trimmedHtml.indexOf("<!doctype html>") === 0 || trimmedHtml.indexOf("<!DOCTYPE html>") === 0;
})
return (
trimmedHtml.indexOf("<!doctype html>") === 0 ||
trimmedHtml.indexOf("<!DOCTYPE html>") === 0
);
});
});

it("should have a <head> tag with the lang attribute on it", function () {
Expand Down

0 comments on commit c19c712

Please sign in to comment.