@@ -4,12 +4,12 @@ import {assert} from 'chai';
44import * as fsSync from 'fs' ;
55
66async function glslifyUninstall ( ) {
7- await npmCommand ( [ 'uninstall' , 'glslify' ] ) ;
7+ await npmCommand ( [ 'uninstall' , 'glslify' , 'glsl-noise' ] ) ;
88 assert . isFalse ( fsSync . existsSync ( 'node_modules/glslify' ) , 'glslify failed to uninstall' ) ;
99}
1010
1111async function glslifyInstall ( ) {
12- await npmCommand ( [ 'install' , '--no-save' , 'glslify' ] ) ;
12+ await npmCommand ( [ 'install' , '--no-save' , 'glslify' , 'glsl-noise' ] ) ;
1313 assert . isTrue ( fsSync . existsSync ( 'node_modules/glslify' ) , 'glslify failed to install' ) ;
1414}
1515
@@ -63,5 +63,15 @@ export function glslifyTests(glslOptimize) {
6363 assert . notInclude ( code , 'sub1' , 'sub1 was not inlined' ) ;
6464 assert . notInclude ( code , 'sub2' , 'sub2 was not inlined' ) ;
6565 } ) ;
66+ it ( 'should import glsl-noise correctly' , async function ( ) {
67+ const bundle = await rollup ( {
68+ input : 'test/fixtures/glslify-noise.js' ,
69+ plugins : [ glslOptimize ( { glslify : true , optimize : false , compress : false } ) ] ,
70+ } ) ;
71+ const generated = await bundle . generate ( { format : 'es' } ) ;
72+ const code = generated . output [ 0 ] . code ;
73+ assert . include ( code , 'taylorInvSqrt' , 'taylorInvSqrt was not included' ) ;
74+ assert . notInclude ( code , 'pragma glslify' , 'pragma glslify was left in' ) ;
75+ } ) ;
6676 } ) ;
6777}
0 commit comments