Skip to content

Commit

Permalink
fix all other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh committed Oct 10, 2023
1 parent 350f0c8 commit d14f1af
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/contented-processor/src/ContentedProcessor.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ describe('process', () => {
]);
});

it('should process :2:path-1.md', async () => {
expect(await processor.process(':2:path-1.md')).toStrictEqual([
it('should process 2-path-1.md', async () => {
expect(await processor.process('2-path-1.md')).toStrictEqual([
{
type: 'Markdown',
fields: {
Expand All @@ -70,8 +70,8 @@ describe('process', () => {
]);
});

it('should process :1:Category/:1:slug.md', async () => {
expect(await processor.process(':1:Category/:1:slug.md')).toStrictEqual([
it('should process 1-Category/2-slug.md', async () => {
expect(await processor.process('1-Category/2-slug.md')).toStrictEqual([
{
type: 'Markdown',
fields: {
Expand All @@ -95,8 +95,8 @@ describe('process', () => {
]);
});

it('should process :1:Category/Section/:2:path.md', async () => {
expect(await processor.process(':1:Category/Section/:2:path.md')).toStrictEqual([
it('should process 1-Category/Section/2-path.md', async () => {
expect(await processor.process('1-Category/Section/2-path.md')).toStrictEqual([
{
type: 'Markdown',
fields: {
Expand Down Expand Up @@ -214,7 +214,7 @@ describe('build', () => {
const processor = new ContentedProcessor(config);

it('should build 2 files', async () => {
const result = await processor.build(':2:path-1.md', ':1:Category/Section/:2:path.md');
const result = await processor.build('2-path-1.md', '1-Category/Section/2-path.md');
expect(result).toStrictEqual({
pipelines: {
Markdown: [
Expand Down Expand Up @@ -256,10 +256,10 @@ describe('build', () => {

it('should build 4 files', async () => {
const result = await processor.build(
':2:path-1.md',
'2-path-1.md',
'Foo.Bar.md',
':1:Category/Section/:2:path.md',
':1:Category/:1:slug.md',
'1-Category/Section/2-path.md',
'1-Category/2-slug.md',
);

expect(result).toStrictEqual({
Expand Down Expand Up @@ -373,7 +373,7 @@ describe('custom', () => {
const processor = new ContentedProcessor(config);

it('should use custom pipeline', async () => {
expect(await processor.process(':2:path-1.md')).toStrictEqual([
expect(await processor.process('2-path-1.md')).toStrictEqual([
{
fileId: expect.stringMatching(/[0-f]{64}/),
modifiedDate: expect.any(Number),
Expand Down Expand Up @@ -431,7 +431,7 @@ it('should dedup 2 files', async () => {
pipelines: [
{
type: 'Markdown',
pattern: '**/:1:Category/*.md',
pattern: '**/1-Category/*.md',
processor: 'md',
},
{
Expand All @@ -442,7 +442,7 @@ it('should dedup 2 files', async () => {
],
};
const processor = new ContentedProcessor(config);
await processor.build(':2:path-1.md', ':1:Category/Section/:2:path.md');
await processor.build('2-path-1.md', '1-Category/Section/2-path.md');
});

it('should sort 2 files', async () => {
Expand All @@ -464,7 +464,7 @@ it('should sort 2 files', async () => {
],
};
const processor = new ContentedProcessor(config);
const files = await processor.build(':2:path-1.md', ':1:Category/Section/:2:path.md');
const files = await processor.build('2-path-1.md', '1-Category/Section/2-path.md');
expect(files.pipelines.Markdown[0]).toMatchObject({
path: '/category/section/path',
});
Expand Down

0 comments on commit d14f1af

Please sign in to comment.