diff --git a/apps/oxlint/test/fixtures/scope_manager/output.snap.md b/apps/oxlint/test/fixtures/scope_manager/output.snap.md index 9823352f1e4ec..4883b17944733 100644 --- a/apps/oxlint/test/fixtures/scope_manager/output.snap.md +++ b/apps/oxlint/test/fixtures/scope_manager/output.snap.md @@ -3,8 +3,19 @@ # stdout ``` - x scope-manager-plugin(scope): File has 12 scopes: , , topLevelFunction, , TopLevelModule, GenericInterface, TestClass, , - | , , , + x scope-manager-plugin(scope): File has 12 scopes: + | - global + | - module + | - function(topLevelFunction) + | - block + | - tsModule(TopLevelModule) + | - type(GenericInterface) + | - class(TestClass) + | - class-static-block + | - function + | - function + | - block + | - block ,-[files/index.ts:1:1] 1 | const { a, b, c } = {}; : ^ diff --git a/apps/oxlint/test/fixtures/scope_manager/plugin.ts b/apps/oxlint/test/fixtures/scope_manager/plugin.ts index 307d0098fbecb..8740a1955f580 100644 --- a/apps/oxlint/test/fixtures/scope_manager/plugin.ts +++ b/apps/oxlint/test/fixtures/scope_manager/plugin.ts @@ -24,9 +24,14 @@ const rule: Rule = { assert.equal(moduleScope.upper, scopeManager.globalScope); context.report({ - message: `File has ${scopeManager.scopes.length} scopes: ${scopeManager.scopes - .map((s: any) => s.block?.id?.name ?? '<' + s.constructor.name + '>') - .join(', ')}`, + message: + `File has ${scopeManager.scopes.length} scopes:\n- ` + + scopeManager.scopes + .map((s: any) => { + const name = s.block?.id?.name; + return name ? `${s.type}(${name})` : `${s.type}`; + }) + .join('\n- '), node: SPAN, });