From db566106964b4876d0780ac2fde2ca8835724cca Mon Sep 17 00:00:00 2001
From: Arsh <69170106+lilnasy@users.noreply.github.com>
Date: Tue, 18 Apr 2023 08:39:05 +0000
Subject: [PATCH] hack(inline stylesheets testing): duplicate fixtures
Content collections reuses build data across multiple fixture.builds, even though a configuration change may have changed it.
Duplicating fixtures avoids usage of the stale cache.
https://cdn.discordapp.com/attachments/1039830843440504872/1097795182340092024/Screenshot_87_colored.png
---
packages/astro/test/css-inline-stylesheets.js | 12 +--
.../{ => always}/package.json | 0
.../{ => always}/src/components/Button.astro | 0
.../{ => always}/src/content/en/endeavour.md | 0
.../{ => always}/src/imported.css | 0
.../{ => always}/src/layouts/Layout.astro | 0
.../{ => always}/src/pages/index.astro | 0
.../css-inline-stylesheets/auto/package.json | 8 ++
.../auto/src/components/Button.astro | 86 +++++++++++++++++++
.../auto/src/content/en/endeavour.md | 15 ++++
.../auto/src/imported.css | 15 ++++
.../auto/src/layouts/Layout.astro | 35 ++++++++
.../auto/src/pages/index.astro | 17 ++++
.../css-inline-stylesheets/never/package.json | 8 ++
.../never/src/components/Button.astro | 86 +++++++++++++++++++
.../never/src/content/en/endeavour.md | 15 ++++
.../never/src/imported.css | 15 ++++
.../never/src/layouts/Layout.astro | 35 ++++++++
.../never/src/pages/index.astro | 17 ++++
pnpm-lock.yaml | 16 +++-
20 files changed, 372 insertions(+), 8 deletions(-)
rename packages/astro/test/fixtures/css-inline-stylesheets/{ => always}/package.json (100%)
rename packages/astro/test/fixtures/css-inline-stylesheets/{ => always}/src/components/Button.astro (100%)
rename packages/astro/test/fixtures/css-inline-stylesheets/{ => always}/src/content/en/endeavour.md (100%)
rename packages/astro/test/fixtures/css-inline-stylesheets/{ => always}/src/imported.css (100%)
rename packages/astro/test/fixtures/css-inline-stylesheets/{ => always}/src/layouts/Layout.astro (100%)
rename packages/astro/test/fixtures/css-inline-stylesheets/{ => always}/src/pages/index.astro (100%)
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/auto/package.json
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/auto/src/components/Button.astro
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/auto/src/content/en/endeavour.md
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/auto/src/imported.css
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/auto/src/layouts/Layout.astro
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/auto/src/pages/index.astro
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/never/package.json
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/never/src/components/Button.astro
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/never/src/content/en/endeavour.md
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/never/src/imported.css
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/never/src/layouts/Layout.astro
create mode 100644 packages/astro/test/fixtures/css-inline-stylesheets/never/src/pages/index.astro
diff --git a/packages/astro/test/css-inline-stylesheets.js b/packages/astro/test/css-inline-stylesheets.js
index 32bcf92af66a..d4009ed85e0f 100644
--- a/packages/astro/test/css-inline-stylesheets.js
+++ b/packages/astro/test/css-inline-stylesheets.js
@@ -8,7 +8,7 @@ describe('Setting inlineStylesheets to never in static output', () => {
before(async () => {
fixture = await loadFixture({
- root: './fixtures/css-inline-stylesheets/',
+ root: './fixtures/css-inline-stylesheets/never/',
output: 'static',
experimental: {
inlineStylesheets: 'never',
@@ -41,7 +41,7 @@ describe('Setting inlineStylesheets to never in server output', () => {
before(async () => {
const fixture = await loadFixture({
- root: './fixtures/css-inline-stylesheets/',
+ root: './fixtures/css-inline-stylesheets/never/',
output: 'server',
adapter: testAdapter(),
experimental: {
@@ -77,7 +77,7 @@ describe('Setting inlineStylesheets to auto in static output', () => {
before(async () => {
fixture = await loadFixture({
- root: './fixtures/css-inline-stylesheets/',
+ root: './fixtures/css-inline-stylesheets/auto/',
output: 'static',
experimental: {
inlineStylesheets: 'auto',
@@ -117,7 +117,7 @@ describe('Setting inlineStylesheets to auto in server output', () => {
before(async () => {
const fixture = await loadFixture({
- root: './fixtures/css-inline-stylesheets/',
+ root: './fixtures/css-inline-stylesheets/auto/',
output: 'server',
adapter: testAdapter(),
experimental: {
@@ -161,7 +161,7 @@ describe('Setting inlineStylesheets to always in static output', () => {
before(async () => {
fixture = await loadFixture({
- root: './fixtures/css-inline-stylesheets/',
+ root: './fixtures/css-inline-stylesheets/always/',
output: 'static',
experimental: {
inlineStylesheets: 'always',
@@ -193,7 +193,7 @@ describe('Setting inlineStylesheets to always in server output', () => {
before(async () => {
const fixture = await loadFixture({
- root: './fixtures/css-inline-stylesheets/',
+ root: './fixtures/css-inline-stylesheets/always/',
output: 'server',
adapter: testAdapter(),
experimental: {
diff --git a/packages/astro/test/fixtures/css-inline-stylesheets/package.json b/packages/astro/test/fixtures/css-inline-stylesheets/always/package.json
similarity index 100%
rename from packages/astro/test/fixtures/css-inline-stylesheets/package.json
rename to packages/astro/test/fixtures/css-inline-stylesheets/always/package.json
diff --git a/packages/astro/test/fixtures/css-inline-stylesheets/src/components/Button.astro b/packages/astro/test/fixtures/css-inline-stylesheets/always/src/components/Button.astro
similarity index 100%
rename from packages/astro/test/fixtures/css-inline-stylesheets/src/components/Button.astro
rename to packages/astro/test/fixtures/css-inline-stylesheets/always/src/components/Button.astro
diff --git a/packages/astro/test/fixtures/css-inline-stylesheets/src/content/en/endeavour.md b/packages/astro/test/fixtures/css-inline-stylesheets/always/src/content/en/endeavour.md
similarity index 100%
rename from packages/astro/test/fixtures/css-inline-stylesheets/src/content/en/endeavour.md
rename to packages/astro/test/fixtures/css-inline-stylesheets/always/src/content/en/endeavour.md
diff --git a/packages/astro/test/fixtures/css-inline-stylesheets/src/imported.css b/packages/astro/test/fixtures/css-inline-stylesheets/always/src/imported.css
similarity index 100%
rename from packages/astro/test/fixtures/css-inline-stylesheets/src/imported.css
rename to packages/astro/test/fixtures/css-inline-stylesheets/always/src/imported.css
diff --git a/packages/astro/test/fixtures/css-inline-stylesheets/src/layouts/Layout.astro b/packages/astro/test/fixtures/css-inline-stylesheets/always/src/layouts/Layout.astro
similarity index 100%
rename from packages/astro/test/fixtures/css-inline-stylesheets/src/layouts/Layout.astro
rename to packages/astro/test/fixtures/css-inline-stylesheets/always/src/layouts/Layout.astro
diff --git a/packages/astro/test/fixtures/css-inline-stylesheets/src/pages/index.astro b/packages/astro/test/fixtures/css-inline-stylesheets/always/src/pages/index.astro
similarity index 100%
rename from packages/astro/test/fixtures/css-inline-stylesheets/src/pages/index.astro
rename to packages/astro/test/fixtures/css-inline-stylesheets/always/src/pages/index.astro
diff --git a/packages/astro/test/fixtures/css-inline-stylesheets/auto/package.json b/packages/astro/test/fixtures/css-inline-stylesheets/auto/package.json
new file mode 100644
index 000000000000..36ae3405054b
--- /dev/null
+++ b/packages/astro/test/fixtures/css-inline-stylesheets/auto/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@test/css-inline-stylesheets",
+ "version": "0.0.0",
+ "private": true,
+ "dependencies": {
+ "astro": "workspace:*"
+ }
+}
diff --git a/packages/astro/test/fixtures/css-inline-stylesheets/auto/src/components/Button.astro b/packages/astro/test/fixtures/css-inline-stylesheets/auto/src/components/Button.astro
new file mode 100644
index 000000000000..3f25cbd3e3ae
--- /dev/null
+++ b/packages/astro/test/fixtures/css-inline-stylesheets/auto/src/components/Button.astro
@@ -0,0 +1,86 @@
+---
+const { class: className = '', style, href } = Astro.props;
+const { variant = 'primary' } = Astro.props;
+---
+
+
+
+