From 725f9512837d3c24991f6f37c28cafd26ab14697 Mon Sep 17 00:00:00 2001 From: Max Bucknell Date: Mon, 19 May 2025 13:35:56 -0700 Subject: [PATCH] Add integration test snippets --- zed/zed.xdg.symlink/snippets/typescript.json | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 zed/zed.xdg.symlink/snippets/typescript.json diff --git a/zed/zed.xdg.symlink/snippets/typescript.json b/zed/zed.xdg.symlink/snippets/typescript.json new file mode 100644 index 0000000..4f386d9 --- /dev/null +++ b/zed/zed.xdg.symlink/snippets/typescript.json @@ -0,0 +1,35 @@ +{ + "itesth": { + "prefix": "itesth", + "description": "Integration test header", + "body": [ + "/* eslint-disable @typescript-eslint/no-unused-expressions */", + "import 'reflect-metadata'", + "", + "import { describe } from 'node:test'", + "", + "import { createDatabase, tearDown, withFixturesIt } from '@lib/database/test'", + "import { createTestContext } from 'baseup/services/internal/engine/context/test'", + "", + "import { expect, use } from 'chai'", + "import chaiAsPromised from 'chai-as-promised'", + "use(chaiAsPromised)", + "", + "$0" + ] + }, + "itests": { + "prefix": "itests", + "description": "Integration test suite", + "body": ["describe('${1:Function name}', () => {", " $0", "})"] + }, + "itest": { + "prefix": "itest", + "description": "Integration test case", + "body": [ + "withFixturesIt([${1:Fixtures...}], '${2:Should...}', async () => {", + " $0", + "})" + ] + } +}