@@ -7,42 +7,35 @@ const basic = path.join(__dirname, 'fixtures', 'basic-origin.glsl')
7
7
const importRequire = path . join ( __dirname , 'fixtures' , 'import-with-require.glsl' )
8
8
9
9
test ( 'glslify-import: basic' , function ( t ) {
10
- glslify . bundle ( basic , {
10
+ var src = glslify ( basic , {
11
11
transform : [ require . resolve ( '../index.js' ) ]
12
- } , function ( err , src ) {
13
- if ( err ) throw err
14
-
15
- t . ok ( / \s u n a l t e r e d \s / . exec ( src ) , 'unaltered variable is unaltered' )
16
- t . ok ( / b a s i c R e q u i r e / . exec ( src ) , 'basic-require.glsl imported dependency is still included' )
17
- t . end ( )
18
- } )
12
+ } ) ;
13
+ t . ok ( / \s u n a l t e r e d \s / . exec ( src ) , 'unaltered variable is unaltered' )
14
+ t . ok ( / b a s i c R e q u i r e / . exec ( src ) , 'basic-require.glsl imported dependency is still included' )
15
+ t . end ( )
19
16
} )
20
17
21
18
test ( 'glslify-import: recursive' , function ( t ) {
22
- glslify . bundle ( recursive , {
19
+ var src = glslify ( recursive , {
23
20
transform : [ require . resolve ( '../index.js' ) ]
24
- } , function ( err , src ) {
25
- if ( err ) throw err
21
+ } ) ;
26
22
27
- t . ok ( / \s u n a l t e r e d \s / . exec ( src ) , 'unaltered variable is unaltered' )
28
- t . ok ( / b a s i c R e q u i r e / . exec ( src ) , 'basic-require.glsl imported dependency is still included' )
29
- t . ok ( ! / \# p r a g m a g l s l i f y / . exec ( src ) , 'no pragmas remaining' )
30
- t . equal ( src . match ( / m a i n \( \) / g) . length , 2 , '2 copies imported' )
31
- t . equal ( src . match ( / \# d e f i n e G L S L I F Y / ) . length , 1 , 'only 1 glslify definition' )
32
- t . end ( )
33
- } )
23
+ t . ok ( / \s u n a l t e r e d \s / . exec ( src ) , 'unaltered variable is unaltered' )
24
+ t . ok ( / b a s i c R e q u i r e / . exec ( src ) , 'basic-require.glsl imported dependency is still included' )
25
+ t . ok ( ! / \# p r a g m a g l s l i f y / . exec ( src ) , 'no pragmas remaining' )
26
+ t . equal ( src . match ( / m a i n \( \) / g) . length , 2 , '2 copies imported' )
27
+ t . equal ( src . match ( / \# d e f i n e G L S L I F Y / ) . length , 1 , 'only 1 glslify definition' )
28
+ t . end ( )
34
29
} )
35
30
36
31
test ( 'glslify-import: require paths modified' , function ( t ) {
37
- glslify . bundle ( importRequire , {
32
+ var src = glslify ( importRequire , {
38
33
transform : [ require . resolve ( '../index.js' ) ]
39
- } , function ( err , src ) {
40
- if ( err ) throw err
34
+ } ) ;
41
35
42
- t . ok ( / b a s i c R e q u i r e / . exec ( src ) , 'basic-require.glsl imported dependency is still included' )
43
- t . ok ( / s u b R e q u i r e 1 / . exec ( src ) , 'subfolder-1/basic-require.glsl imported dependency is still included' )
44
- t . ok ( / s u b R e q u i r e 2 / . exec ( src ) , 'subfolder-2/basic-require.glsl imported dependency is still included' )
45
- t . ok ( ! / \# p r a g m a g l s l i f y / . exec ( src ) , 'no pragmas remaining' )
46
- t . end ( )
47
- } )
36
+ t . ok ( / b a s i c R e q u i r e / . exec ( src ) , 'basic-require.glsl imported dependency is still included' )
37
+ t . ok ( / s u b R e q u i r e 1 / . exec ( src ) , 'subfolder-1/basic-require.glsl imported dependency is still included' )
38
+ t . ok ( / s u b R e q u i r e 2 / . exec ( src ) , 'subfolder-2/basic-require.glsl imported dependency is still included' )
39
+ t . ok ( ! / \# p r a g m a g l s l i f y / . exec ( src ) , 'no pragmas remaining' )
40
+ t . end ( )
48
41
} )
0 commit comments