mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
fix
This commit is contained in:
parent
b79a6b0505
commit
aeec14ae89
3 changed files with 11 additions and 9 deletions
|
@ -85,13 +85,13 @@ export function vitePluginActions({
|
|||
code += `\nexport * from 'astro/actions/runtime/virtual/server.js';`;
|
||||
} else {
|
||||
code += `\nexport * from 'astro/actions/runtime/virtual/client.js';`;
|
||||
code = code.replace(
|
||||
"'/** @TRAILING_SLASH@ **/'",
|
||||
JSON.stringify(
|
||||
shouldAppendForwardSlash(settings.config.trailingSlash, settings.config.build.format),
|
||||
),
|
||||
);
|
||||
}
|
||||
code = code.replace(
|
||||
"'/** @TRAILING_SLASH@ **/'",
|
||||
JSON.stringify(
|
||||
shouldAppendForwardSlash(settings.config.trailingSlash, settings.config.build.format),
|
||||
),
|
||||
);
|
||||
return code;
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import {
|
||||
ActionError,
|
||||
ACTION_QUERY_PARAMS,
|
||||
appendForwardSlash,
|
||||
deserializeActionResult,
|
||||
getActionQueryString,
|
||||
appendForwardSlash,
|
||||
} from 'astro:actions';
|
||||
|
||||
const ENCODED_DOT = '%2E';
|
||||
|
|
|
@ -593,14 +593,15 @@ it('getActionPath() should return the right path', async () => {
|
|||
root: './fixtures/actions/',
|
||||
adapter: testAdapter(),
|
||||
base: '/base',
|
||||
trailingSlash: 'always',
|
||||
});
|
||||
const devServer = await fixture.startDevServer();
|
||||
const res = await fixture.fetch('/base/get-action-path');
|
||||
const res = await fixture.fetch('/base/get-action-path/');
|
||||
|
||||
assert.equal(res.ok, true);
|
||||
const html = await res.text();
|
||||
let $ = cheerio.load(html);
|
||||
assert.equal($('[data-path]').text(), '/base/_actions/transformFormInput');
|
||||
assert.equal($('[data-path]').text(), '/base/_actions/transformFormInput/');
|
||||
await devServer.stop();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue