diff --git a/packages/build_system/src/builder/plugin/__tests__/static.param.builder.test.ts b/packages/build_system/src/builder/plugin/__tests__/static.param.builder.test.ts index 3730d60..9fbd0ae 100644 --- a/packages/build_system/src/builder/plugin/__tests__/static.param.builder.test.ts +++ b/packages/build_system/src/builder/plugin/__tests__/static.param.builder.test.ts @@ -6,22 +6,30 @@ describe('StaticParamBuilderPlugin', () => { it('should inject static params to the content', async () => { const plugin = new StaticParamBuilderPlugin() plugin.injectDynamicConfig({ - paramShape: '/[...posts]', + paramShape: '/posts/$page/[...posts]', + maxPage: 2, }) - const { buildFileNames, buildFiles } = await Tester.pipe({ + const { buildFiles } = await Tester.pipe({ plugin: { 'walk:tree': plugin, }, }) const metaList = buildFiles.contents.map((e) => e.meta!.params) - const expectedPostParams = buildFileNames.contents.map((e) => { - const param = e.split('.').slice(0, -1)[0] - return { - posts: param, - } - }) - expect(metaList).toEqual(expectedPostParams) + expect(metaList).toEqual([ + { + posts: 'posts/1/img', + }, + { + posts: 'posts/1/link', + }, + { + posts: 'posts/2/markdown', + }, + { + posts: 'posts/2/nested/nested/nested', + }, + ]) }) })