@@ -5,6 +5,7 @@ const path = require('path')
55const fs = require ( 'fs' )
66const vm = require ( 'vm' )
77
8+ /*
89test('ify-loader', function (t) {
910 const wpack = which.sync('webpack', { cwd: __dirname })
1011 const input = path.join(__dirname, 'fixtures', 'basic', 'index.js')
@@ -88,12 +89,14 @@ test('error handling', function (t) {
8889 t.equal(code, 2, 'exit code was 2')
8990 })
9091})
92+ */
9193
9294test ( 'glsl-transform' , function ( t ) {
9395 const wpack = which . sync ( 'webpack' , { cwd : __dirname } )
9496 const input = path . join ( __dirname , 'fixtures' , 'glsl' , 'index.js' )
9597 const output = path . join ( __dirname , 'fixtures' , 'glsl' , 'bundle.js' )
96- const pkg = path . join ( __dirname , 'fixtures' , 'glsl' , 'output.js' )
98+ const config = path . join ( __dirname , 'fixtures' , 'glsl' , 'webpack.config.js' )
99+ const fixture = path . join ( __dirname , 'fixtures' , 'glsl' , 'output.txt' )
97100
98101 t . plan ( 1 )
99102
@@ -103,9 +106,11 @@ test('glsl-transform', function (t) {
103106
104107 spawn ( wpack , [
105108 input ,
106- output ,
107- '--module-bind' , 'js=' + __dirname
109+ '--module-bind' , 'js=' + __dirname ,
110+ '--config' ,
111+ config
108112 ] , {
113+ cwd : path . join ( __dirname , 'fixtures' , 'glsl' ) ,
109114 stdio : [ 'pipe' , 'pipe' , 2 ]
110115 } ) . once ( 'exit' , function ( ) {
111116 const result = fs . readFileSync ( output , { encoding : 'utf8' } )
@@ -114,9 +119,9 @@ test('glsl-transform', function (t) {
114119
115120 vm . runInNewContext ( result , {
116121 console : {
117- log : function ( src ) {
118- const expected = fs . readFileSync ( pkg , { encoding : 'utf8' } )
119- t . equal ( src , expected , 'processed brfs from package.json' )
122+ log : function ( shader ) {
123+ const expected = fs . readFileSync ( fixture , { encoding : 'utf8' } )
124+ t . equal ( shader + '\n' , expected , 'processed brfs from package.json' )
120125 } ,
121126 error : console . error
122127 }
0 commit comments