File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ import * as semver from 'semver' ;
2
+
3
+ import TemplateLinter from '../src/template-linter' ;
4
+ import { type Server } from '../src' ;
5
+ import { TextDocument } from 'vscode-languageserver-textdocument' ;
6
+
7
+ describe ( 'template-linter' , function ( ) {
8
+ describe ( 'sourcesForDocument' , function ( ) {
9
+ const linter = new TemplateLinter ( {
10
+ options : {
11
+ type : 'node' ,
12
+ } ,
13
+ } as Server ) ;
14
+
15
+ it ( 'supports empty template-lint version' , function ( ) {
16
+ const doc : TextDocument = {
17
+ uri : 'test.gjs' ,
18
+ getText ( ) {
19
+ return 'let a = 12;<template>1</template>' ;
20
+ } ,
21
+ } as TextDocument ;
22
+
23
+ expect ( linter [ 'sourcesForDocument' ] ( doc , null ) ) . toEqual ( [ 'let a = 12;<template>1</template>' ] ) ;
24
+ } ) ;
25
+ it ( 'process gjs for template-lint v4' , function ( ) {
26
+ const doc : TextDocument = {
27
+ uri : 'test.gjs' ,
28
+ getText ( ) {
29
+ return 'let a = 12;<template>1</template>' ;
30
+ } ,
31
+ } as TextDocument ;
32
+
33
+ console . log ( semver . parse ( '~4.3.1' ) ) ;
34
+ expect ( linter [ 'sourcesForDocument' ] ( doc , semver . parse ( '~4.3.1' ) ) ) . toEqual ( [ '<template>1</template>' ] ) ;
35
+ } ) ;
36
+ } ) ;
37
+ } ) ;
You can’t perform that action at this time.
0 commit comments