import netlifyAdapter from '../../dist/index.js';
import { testIntegration, loadFixture } from './test-utils.js';
import { expect } from 'chai';
describe('Middleware', () => {
it('with edge handle file, should successfully build the middleware', async () => {
/** @type {import('./test-utils').Fixture} */
const fixture = await loadFixture({
root: new URL('./fixtures/middleware-with-handler-file/', import.meta.url).toString(),
output: 'server',
adapter: netlifyAdapter({
dist: new URL('./fixtures/middleware-with-handler-file/dist/', import.meta.url),
edgeMiddleware: true,
}),
site: `http://example.com`,
integrations: [testIntegration()],
build: {
excludeMiddleware: true,
},
});
await fixture.build();
const contents = await fixture.readFile('../.netlify/edge-functions/edgeMiddleware.js');
expect(contents.includes('"Hello world"')).to.be.true;
});
it('without edge handle file, should successfully build the middleware', async () => {
/** @type {import('./test-utils').Fixture} */
const fixture = await loadFixture({
root: new URL('./fixtures/middleware-without-handler-file/', import.meta.url).toString(),
output: 'server',
adapter: netlifyAdapter({
dist: new URL('./fixtures/middleware-without-handler-file/dist/', import.meta.url),
}),
site: `http://example.com`,
integrations: [testIntegration()],
build: {
excludeMiddleware: true,
},
});
await fixture.build();
const contents = await fixture.readFile('../.netlify/edge-functions/edgeMiddleware.js');
expect(contents.includes('"Hello world"')).to.be.false;
});
});
8f6&follow=1'>diff
|
Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
Fix some unused variables on the PML implementation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Changing the output directory for the boosted frame diag tests from lab_frame_diag/ to lab_frame_diag/snapshots/
* resolving a conflict in Source/Make.WarpX. Using lower case for libraries += -lhdf5 -lz
* reverting path of labframe data files similar to that in the dev file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Recursively parse the whole project and add as many pre-defines
as possible for maximum code discovery.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|