33/** @import { AdditionalComment } from '../src/languages/types.js' */
44import { expect , test } from 'vitest' ;
55import { print } from '../src/index.js' ;
6- import { load } from './common.js' ;
6+ import { acornParse } from './common.js' ;
77import ts from '../src/languages/ts/index.js' ;
88
99/**
@@ -40,7 +40,7 @@ test('additional comments are inserted correctly', () => {
4040 return x;
4141}` ;
4242
43- const { ast } = load ( input ) ;
43+ const { ast } = acornParse ( input ) ;
4444 const returnStatement = get_return_statement ( ast ) ;
4545 expect ( returnStatement . type ) . toBe ( 'ReturnStatement' ) ;
4646
@@ -66,7 +66,7 @@ test('additional comments are inserted correctly', () => {
6666
6767test ( 'only leading comments are inserted when specified' , ( ) => {
6868 const input = `function test() { return 42; }` ;
69- const { ast } = load ( input ) ;
69+ const { ast } = acornParse ( input ) ;
7070 const returnStatement = get_return_statement ( ast ) ;
7171
7272 /** @type {AdditionalComment[] } */
@@ -86,7 +86,7 @@ test('only leading comments are inserted when specified', () => {
8686
8787test ( 'only trailing comments are inserted when specified' , ( ) => {
8888 const input = `function test() { return 42; }` ;
89- const { ast } = load ( input ) ;
89+ const { ast } = acornParse ( input ) ;
9090 const returnStatement = get_return_statement ( ast ) ;
9191
9292 /** @type {AdditionalComment[] } */
@@ -110,7 +110,7 @@ test('additional comments multi-line comments have new line', () => {
110110 return x;
111111}` ;
112112
113- const { ast } = load ( input ) ;
113+ const { ast } = acornParse ( input ) ;
114114 const returnStatement = get_return_statement ( ast ) ;
115115 expect ( returnStatement . type ) . toBe ( 'ReturnStatement' ) ;
116116
0 commit comments