@@ -60,49 +60,6 @@ describe('js-file', function() {
60
60
} ) ;
61
61
} ) ;
62
62
63
- describe ( 'getNodeByRange' , function ( ) {
64
- it ( 'should get node by range for function declaration' , function ( ) {
65
- expect ( createJsFile ( 'function foo(a,b) {}' ) . getNodeByRange ( 16 ) . type ) . to . equal ( 'FunctionDeclaration' ) ;
66
- } ) ;
67
-
68
- it ( 'should get node by range for identifier' , function ( ) {
69
- expect ( createJsFile ( 'foo(a,b)' ) . getNodeByRange ( 0 ) . type ) . to . equal ( 'Identifier' ) ;
70
- } ) ;
71
-
72
- it ( 'should get node by range for function expression' , function ( ) {
73
- expect ( createJsFile ( 'foo(a,b)' ) . getNodeByRange ( 7 ) . type ) . to . equal ( 'CallExpression' ) ;
74
- } ) ;
75
-
76
- it ( 'should get node by range for "if" statement' , function ( ) {
77
- expect ( createJsFile ( 'if(true){foo(a,b)}' ) . getNodeByRange ( 0 ) . type ) . to . equal ( 'IfStatement' ) ;
78
- } ) ;
79
-
80
- it ( 'should get node by range for identifier inside "if" statement' , function ( ) {
81
- expect ( createJsFile ( 'if(true){foo(a,b)}' ) . getNodeByRange ( 9 ) . type ) . to . equal ( 'Identifier' ) ;
82
- } ) ;
83
-
84
- it ( 'should get node by range for function expression inside "if" statement' , function ( ) {
85
- expect ( createJsFile ( 'if(true){foo(a,b)}' ) . getNodeByRange ( 16 ) . type ) . to . equal ( 'CallExpression' ) ;
86
- } ) ;
87
-
88
- it ( 'should get node by range for function expression with additional parentheses' , function ( ) {
89
- expect ( createJsFile ( 'foo(1,(2))' ) . getNodeByRange ( 9 ) . type ) . to . equal ( 'CallExpression' ) ;
90
- } ) ;
91
-
92
- it ( 'should return empty object' , function ( ) {
93
- expect ( createJsFile ( 'foo(1,2)' ) . getNodeByRange ( 20 ) . type ) . to . equal ( undefined ) ;
94
- } ) ;
95
-
96
- it ( 'should not throw on regexp' , function ( ) {
97
- var file = createJsFile ( '/^/' ) ;
98
- try {
99
- file . getNodeByRange ( 1 ) ;
100
- } catch ( e ) {
101
- throw new Error ( ) ;
102
- }
103
- } ) ;
104
- } ) ;
105
-
106
63
describe ( 'findNextToken' , function ( ) {
107
64
var file ;
108
65
0 commit comments