static.test.js 654 B

12345678910111213141516171819202122232425
  1. import { loadFixture } from './test-utils.js';
  2. import assert from 'node:assert/strict';
  3. import { before, describe, it } from 'node:test';
  4. describe('static routing', () => {
  5. /** @type {import('./test-utils.js').Fixture} */
  6. let fixture;
  7. before(async () => {
  8. fixture = await loadFixture({
  9. root: './fixtures/static/',
  10. });
  11. await fixture.build();
  12. });
  13. it('falls back to 404.html', async () => {
  14. const deploymentConfig = JSON.parse(await fixture.readFile('../.vercel/output/config.json'));
  15. // change the index if necesseary
  16. assert.deepEqual(deploymentConfig.routes[2], {
  17. src: '/.*',
  18. dest: '/404.html',
  19. status: 404,
  20. });
  21. });
  22. });