@@ -5,10 +5,6 @@ import type { Node } from "postcss";
5
5
6
6
import { parseForESLint } from "../../../src" ;
7
7
import type { SourceLocation } from "../../../src/ast" ;
8
- import {
9
- styleNodeLoc ,
10
- styleNodeRange ,
11
- } from "../../../src/parser/style-context" ;
12
8
import { generateParserOptions , listupFixtures } from "./test-utils" ;
13
9
14
10
const STYLE_CONTEXT_FIXTURE_ROOT = path . resolve (
@@ -29,26 +25,29 @@ describe("Check for AST.", () => {
29
25
meetRequirements,
30
26
} of listupFixtures ( STYLE_CONTEXT_FIXTURE_ROOT ) ) {
31
27
describe ( inputFileName , ( ) => {
32
- let result : any ;
28
+ let services : any ;
33
29
34
30
it ( "most to generate the expected style context." , ( ) => {
35
- result = parse ( input , inputFileName , config ) ;
31
+ services = parse ( input , inputFileName , config ) . services ;
36
32
if ( ! meetRequirements ( "test" ) ) {
37
33
return ;
38
34
}
39
- const styleContext = result . services . getStyleContext ( ) ;
35
+ const styleContext = services . getStyleContext ( ) ;
40
36
assert . strictEqual ( styleContext . status , "success" ) ;
41
37
const locations : [
42
38
Partial < SourceLocation > ,
43
39
[ number | undefined , number | undefined ]
44
40
] [ ] = [
45
41
[
46
- styleNodeLoc ( styleContext . sourceAst ) ,
47
- styleNodeRange ( styleContext . sourceAst ) ,
42
+ services . styleNodeLoc ( styleContext . sourceAst ) ,
43
+ services . styleNodeRange ( styleContext . sourceAst ) ,
48
44
] ,
49
45
] ;
50
46
styleContext . sourceAst . walk ( ( node : Node ) => {
51
- locations . push ( [ styleNodeLoc ( node ) , styleNodeRange ( node ) ] ) ;
47
+ locations . push ( [
48
+ services . styleNodeLoc ( node ) ,
49
+ services . styleNodeRange ( node ) ,
50
+ ] ) ;
52
51
} ) ;
53
52
const output = fs . readFileSync ( outputFileName , "utf8" ) ;
54
53
assert . strictEqual (
0 commit comments