@@ -17,10 +17,10 @@ import { assert } from "chai";
1717import { groupBy , uniq } from "lodash-es" ;
1818import { promises as fsp } from "node:fs" ;
1919import { endToEndTestSetup } from "../endToEndTestSetup" ;
20- // import {
21- // serializeIterationScopeFixture,
22- // serializeScopeFixture,
23- // } from "./serializeScopeFixture";
20+ import {
21+ serializeIterationScopeFixture ,
22+ serializeScopeFixture ,
23+ } from "./serializeScopeFixture" ;
2424
2525suite ( "Scope test cases" , async function ( ) {
2626 endToEndTestSetup ( this ) ;
@@ -123,43 +123,33 @@ async function runTest(file: string, languageId: string, facetId: string) {
123123
124124 const editor = ide . activeTextEditor ! ;
125125
126- if ( editor == null ) {
127- console . log ( "editor" == null ) ;
128- }
126+ const outputFixture = ( ( ) : string => {
127+ const config = {
128+ visibleOnly : false ,
129+ scopeType,
130+ } ;
131+
132+ if ( isIteration ) {
133+ const iterationScopes = scopeProvider . provideIterationScopeRanges (
134+ editor ,
135+ {
136+ ...config ,
137+ includeNestedTargets : false ,
138+ } ,
139+ ) ;
140+ return serializeIterationScopeFixture ( code , iterationScopes ) ;
141+ }
129142
130- if ( ! scopeProvider && ! scopeType && ! isIteration && ! code && ! ide ) {
131- console . log ( "weird" ) ;
132- }
143+ const scopes = scopeProvider . provideScopeRanges ( editor , config ) ;
133144
134- // const outputFixture = ((): string => {
135- // const config = {
136- // visibleOnly: false,
137- // scopeType,
138- // };
139-
140- // if (isIteration) {
141- // const iterationScopes = scopeProvider.provideIterationScopeRanges(
142- // editor,
143- // {
144- // ...config,
145- // includeNestedTargets: false,
146- // },
147- // );
148- // return serializeIterationScopeFixture(code, iterationScopes);
149- // }
150-
151- // const scopes = scopeProvider.provideScopeRanges(editor, config);
152-
153- // return serializeScopeFixture(facetId, code, scopes);
154- // })();
155-
156- assert . ok ( true ) ;
157-
158- // if (shouldUpdateFixtures()) {
159- // await fsp.writeFile(file, outputFixture);
160- // } else {
161- // assert.equal(outputFixture, fixture);
162- // }
145+ return serializeScopeFixture ( facetId , code , scopes ) ;
146+ } ) ( ) ;
147+
148+ if ( shouldUpdateFixtures ( ) ) {
149+ await fsp . writeFile ( file , outputFixture ) ;
150+ } else {
151+ assert . equal ( outputFixture , fixture ) ;
152+ }
163153}
164154
165155function getFacetInfo (
0 commit comments