[ci] format
This commit is contained in:
parent
b2f0210c40
commit
64b24f0663
2 changed files with 8 additions and 8 deletions
|
@ -146,11 +146,11 @@ function buildManifest(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (settings.scripts.some((script) => script.stage === 'page')) {
|
if (settings.scripts.some((script) => script.stage === 'page')) {
|
||||||
const src = entryModules[PAGE_SCRIPT_ID];
|
const src = entryModules[PAGE_SCRIPT_ID];
|
||||||
|
|
||||||
scripts.push({
|
scripts.push({
|
||||||
type: 'external',
|
type: 'external',
|
||||||
value: joinBase(src)
|
value: joinBase(src),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ describe('Using Astro.request in SSR', () => {
|
||||||
name: 'inject-script',
|
name: 'inject-script',
|
||||||
hooks: {
|
hooks: {
|
||||||
'astro:config:setup'({ injectScript }) {
|
'astro:config:setup'({ injectScript }) {
|
||||||
injectScript('page', 'import "/src/scripts/inject-script.js";')
|
injectScript('page', 'import "/src/scripts/inject-script.js";');
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
vite: {
|
vite: {
|
||||||
build: {
|
build: {
|
||||||
|
@ -74,13 +74,13 @@ describe('Using Astro.request in SSR', () => {
|
||||||
const html = await response.text();
|
const html = await response.text();
|
||||||
const $ = cheerioLoad(html);
|
const $ = cheerioLoad(html);
|
||||||
|
|
||||||
for(const el of $('script')) {
|
for (const el of $('script')) {
|
||||||
const scriptSrc = $(el).attr('src');
|
const scriptSrc = $(el).attr('src');
|
||||||
expect(scriptSrc.startsWith('/subpath/')).to.equal(true);
|
expect(scriptSrc.startsWith('/subpath/')).to.equal(true);
|
||||||
|
|
||||||
request = new Request('http://example.com' + scriptSrc);
|
request = new Request('http://example.com' + scriptSrc);
|
||||||
response = await app.render(request);
|
response = await app.render(request);
|
||||||
|
|
||||||
expect(response.status).to.equal(200);
|
expect(response.status).to.equal(200);
|
||||||
const js = await response.text();
|
const js = await response.text();
|
||||||
expect(js).to.not.be.an('undefined');
|
expect(js).to.not.be.an('undefined');
|
||||||
|
|
Loading…
Reference in a new issue