-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
css imports and raw plugin interop with test cases
- Loading branch information
1 parent
292ddfb
commit 56a7657
Showing
26 changed files
with
228 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
packages/cli/test/cases/exp-build.import-attributes/exp-build.import-attributes.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Use Case | ||
* Run Greenwood serve command with no config for using import attributes with a basic static bundles. | ||
* | ||
* User Result | ||
* Should start the development server and render a bare bones Greenwood build. | ||
* | ||
* User Command | ||
* greenwood serve | ||
* | ||
* User Config | ||
* {} | ||
* | ||
* User Workspace | ||
* src/ | ||
* components/ | ||
* card/ | ||
* card.css | ||
* card.js | ||
* card.json | ||
* pages/ | ||
* index.html | ||
* | ||
*/ | ||
import chai from 'chai'; | ||
import fs from 'fs'; | ||
import glob from 'glob-promise'; | ||
import path from 'path'; | ||
import { Runner } from 'gallinago'; | ||
import { fileURLToPath, URL } from 'url'; | ||
|
||
const expect = chai.expect; | ||
|
||
describe('Build Greenwood With: ', function() { | ||
const LABEL = 'Import Attributes used in static pages'; | ||
const cliPath = path.join(process.cwd(), 'packages/cli/src/index.js'); | ||
const outputPath = fileURLToPath(new URL('.', import.meta.url)); | ||
const hostname = 'http://localhost:8080'; | ||
let runner; | ||
|
||
before(function() { | ||
this.context = { | ||
hostname | ||
}; | ||
runner = new Runner(false, true); | ||
}); | ||
|
||
describe(LABEL, function() { | ||
|
||
before(async function() { | ||
runner.setup(outputPath); | ||
runner.runCommand(cliPath, 'build'); | ||
}); | ||
|
||
describe('Importing CSS w/ Constructable Stylesheets', function() { | ||
let scripts; | ||
|
||
before(async function() { | ||
scripts = await glob.promise(path.join(outputPath, 'public/card.*.js')); | ||
}); | ||
|
||
it('should have the expected output from importing hero.css as a Constructable Stylesheet', function() { | ||
const scriptContents = fs.readFileSync(scripts[0], 'utf-8'); | ||
|
||
expect(scriptContents).to.contain('const e=new CSSStyleSheet;e.replaceSync(":host { color: red; }");'); | ||
}); | ||
}); | ||
}); | ||
|
||
after(function() { | ||
runner.stopCommand(); | ||
runner.teardown([ | ||
path.join(outputPath, '.greenwood'), | ||
path.join(outputPath, 'node_modules') | ||
]); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
packages/cli/test/cases/exp-build.import-attributes/src/pages/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script type="module" src="../components/card/card.js"></script> | ||
</head> | ||
|
||
<body> | ||
<h1>The home page</h1> | ||
<app-card></app-card> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
packages/cli/test/cases/exp-serve.default.ssr-import-attributes/src/components/card/card.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host { | ||
color: red; | ||
} |
Oops, something went wrong.