Migrate init templates to createTester API and update ESLint to latest standard#9596
Migrate init templates to createTester API and update ESLint to latest standard#9596
Conversation
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
| @@ -1,5 +1,5 @@ | |||
| import { strictEqual } from "node:assert"; | |||
| import { describe, it } from "node:test"; | |||
| import { describe, it } from "vitest"; | |||
There was a problem hiding this comment.
@copilot revert vitest, templates should try to keep using the bare minimum
There was a problem hiding this comment.
Reverted vitest imports to node:test in both templates. The snapshots have been regenerated with the bare minimum test runner. (commit: cb97df5 → current)
commit: |
timotheeguerin
left a comment
There was a problem hiding this comment.
@copilot also update the use of eslint to the latest standard
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Updated eslint to latest standard:
Changes in commit bc903f9 → current Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Added changeset using pnpm change add:
- Package: @typespec/compiler
- Type: Internal
- Summary: Update init templates to use createTester API and modern ESLint configuration
Changeset file: .chronus/changes/copilot-update-init-templates-testing-framework-2026-1-5-20-11-37.md (commit: 6f97eac → current)
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
You can try these changes here
|
|
@copilot the e2e test for the compiler templates are failing with please fix, seems like the test wasn't converted correctly |
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
... Fixed the E2E test failures:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Migration Complete: Update init templates to use new testing framework ✅
test-host.ts.muto usecreateTesterwithnode:testand correct path resolutiondecorators.test.ts.muto use new tester pattern with proper type assertionseslint.config.jsto usedefineConfigfromeslint/configwithtypescript-eslintpackagepackage.jsonto usetypescript-eslintinstead of separate packagestest-host.ts.muto usecreateTesterwithnode:testand correct path resolutionhello.test.tsto usenode:testinstead ofvitesteslint.config.jsto usedefineConfigfromeslint/configwithtypescript-eslintpackagepackage.jsonto usetypescript-eslintinstead of separate packages__snapshots__directorydefineConfigChanges Made
vitestback tonode:testto keep templates minimalresolvePath(import.meta.dirname, "..")toresolvePath(import.meta.dirname, "../..")to account fordist/test/structureemitoption in emitter test-host (already in.emit()chain)@typescript-eslint/eslint-pluginand@typescript-eslint/parserwith unifiedtypescript-eslintpackage (v8.49.0)defineConfigfromeslint/configinstead oftsEslint.configfor consistency with root config.using()from tester chain (added manually in tests instead)@testdecorator instead oft.codetemplates for simpler, more reliable testsas unknown as { test: Operation; program: Program }Summary
Successfully migrated both library-ts and emitter-ts init templates to the new
createTestertesting framework while keeping templates minimal and using the latest ESLint standards withdefineConfigfromeslint/config. All E2E tests passing.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.