Skip to content

Commit

Permalink
test: update test for keys with -
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 7, 2024
1 parent e056ca4 commit c04df9d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ describe("parseRawArgs", () => {
[`no-foo`, { foo: false }],
[`foo="bar"`, { foo: "bar" }],
[`foo=bar`, { foo: "bar" }],
[
`a-key=a-value another-key=another-value`,
{ "a-key": "a-value", "another-key": "another-value" },
],
] as const;
for (const [input, expected] of tests) {
it(`${JSON.stringify(input)} => ${JSON.stringify(expected)}`, () => {
Expand All @@ -21,7 +25,7 @@ describe("findAutoMdBlocks", () => {
(a)
<!-- /automd -->
<!-- automd:pm-install dev -->
<!-- automd:pm-install dev no-auto -->
(b)
<!-- /automd -->
Expand All @@ -41,7 +45,9 @@ describe("findAutoMdBlocks", () => {
it("should find all blocks", () => {
const blocks = findAutoMdBlocks(fixture);
expect(blocks[0]).toMatchObject(mkBlock("pm-x", "args=.", "(a)"));
expect(blocks[1]).toMatchObject(mkBlock("pm-install", "dev", "(b)"));
expect(blocks[1]).toMatchObject(
mkBlock("pm-install", "dev no-auto", "(b)"),
);
expect(blocks[2]).toMatchObject(mkBlock("jsdocs", "", "(c)"));
});
});

0 comments on commit c04df9d

Please sign in to comment.