2525
2626tap . test ( 'async1' , function ( t ) {
2727 runProgram ( 'async-await' , 'async1.js' , function ( r ) {
28- t . deepEqual ( stripFullStack ( r . stdout . toString ( 'utf8' ) ) , [
28+ t . deepEqual ( stripFullStack ( r . stdout ) , [
2929 'TAP version 13' ,
3030 '# async1' ,
3131 'ok 1 before await' ,
@@ -40,14 +40,14 @@ tap.test('async1', function (t) {
4040 ''
4141 ] ) ;
4242 t . same ( r . exitCode , 0 ) ;
43- t . same ( stripDeprecations ( r . stderr . toString ( 'utf8' ) ) , '' ) ;
43+ t . same ( stripDeprecations ( r . stderr ) , '' ) ;
4444 t . end ( ) ;
4545 } ) ;
4646} ) ;
4747
4848tap . test ( 'async2' , function ( t ) {
4949 runProgram ( 'async-await' , 'async2.js' , function ( r ) {
50- var stdout = r . stdout . toString ( 'utf8' ) ;
50+ var stdout = r . stdout ;
5151 var lines = stdout . split ( '\n' ) . filter ( function ( line ) {
5252 return ! ( / ^ ( \s + ) a t ( \s + ) < a n o n y m o u s > $ / ) . test ( line ) ;
5353 } ) ;
@@ -76,14 +76,14 @@ tap.test('async2', function (t) {
7676 ''
7777 ] ) ;
7878 t . same ( r . exitCode , 1 ) ;
79- t . same ( stripDeprecations ( r . stderr . toString ( 'utf8' ) ) , '' ) ;
79+ t . same ( stripDeprecations ( r . stderr ) , '' ) ;
8080 t . end ( ) ;
8181 } ) ;
8282} ) ;
8383
8484tap . test ( 'async3' , function ( t ) {
8585 runProgram ( 'async-await' , 'async3.js' , function ( r ) {
86- t . deepEqual ( stripFullStack ( r . stdout . toString ( 'utf8' ) ) , [
86+ t . deepEqual ( stripFullStack ( r . stdout ) , [
8787 'TAP version 13' ,
8888 '# async3' ,
8989 'ok 1 before await' ,
@@ -98,14 +98,14 @@ tap.test('async3', function (t) {
9898 ''
9999 ] ) ;
100100 t . same ( r . exitCode , 0 ) ;
101- t . same ( stripDeprecations ( r . stderr . toString ( 'utf8' ) ) , '' ) ;
101+ t . same ( stripDeprecations ( r . stderr ) , '' ) ;
102102 t . end ( ) ;
103103 } ) ;
104104} ) ;
105105
106106tap . test ( 'async4' , function ( t ) {
107107 runProgram ( 'async-await' , 'async4.js' , function ( r ) {
108- t . deepEqual ( stripFullStack ( r . stdout . toString ( 'utf8' ) ) , [
108+ t . deepEqual ( stripFullStack ( r . stdout ) , [
109109 'TAP version 13' ,
110110 '# async4' ,
111111 'ok 1 before await' ,
@@ -127,14 +127,14 @@ tap.test('async4', function (t) {
127127 ''
128128 ] ) ;
129129 t . same ( r . exitCode , 1 ) ;
130- t . same ( stripDeprecations ( r . stderr . toString ( 'utf8' ) ) , '' ) ;
130+ t . same ( stripDeprecations ( r . stderr ) , '' ) ;
131131 t . end ( ) ;
132132 } ) ;
133133} ) ;
134134
135135tap . test ( 'async5' , function ( t ) {
136136 runProgram ( 'async-await' , 'async5.js' , function ( r ) {
137- t . same ( stripFullStack ( r . stdout . toString ( 'utf8' ) ) , [
137+ t . same ( stripFullStack ( r . stdout ) , [
138138 'TAP version 13' ,
139139 '# async5' ,
140140 'ok 1 before server' ,
@@ -181,29 +181,28 @@ tap.test('async5', function (t) {
181181 ''
182182 ] ) ;
183183 t . same ( r . exitCode , 1 ) ;
184- t . same ( stripDeprecations ( r . stderr . toString ( 'utf8' ) ) , '' ) ;
184+ t . same ( stripDeprecations ( r . stderr ) , '' ) ;
185185 t . end ( ) ;
186186 } ) ;
187187} ) ;
188188
189189tap . test ( 'sync-error' , function ( t ) {
190190 runProgram ( 'async-await' , 'sync-error.js' , function ( r ) {
191- t . same ( stripFullStack ( r . stdout . toString ( 'utf8' ) ) , [
191+ t . same ( stripFullStack ( r . stdout ) , [
192192 'TAP version 13' ,
193193 '# sync-error' ,
194194 'ok 1 before throw' ,
195195 ''
196196 ] ) ;
197197 t . same ( r . exitCode , 1 ) ;
198198
199- var stderr = r . stderr . toString ( 'utf8' ) ;
200- var lines = stderr . split ( '\n' ) ;
199+ var lines = r . stderr . split ( '\n' ) ;
201200 lines = lines . filter ( function ( line ) {
202201 return ! ( / \( t i m e r s .j s : / ) . test ( line )
203202 && ! ( / \( i n t e r n a l \/ t i m e r s .j s : / ) . test ( line )
204203 && ! ( / I m m e d i a t e \. n e x t / ) . test ( line ) ;
205204 } ) ;
206- stderr = lines . join ( '\n' ) ;
205+ var stderr = lines . join ( '\n' ) ;
207206
208207 t . same ( stripFullStack ( stripDeprecations ( stderr ) ) , [ ] . concat (
209208 '$TEST/async-await/sync-error.js:7' ,
@@ -228,12 +227,11 @@ tap.test('sync-error', function (t) {
228227
229228tap . test ( 'async-error' , function ( t ) {
230229 runProgram ( 'async-await' , 'async-error.js' , function ( r ) {
231- var stdout = r . stdout . toString ( 'utf8' ) ;
232- var lines = stdout . split ( '\n' ) ;
230+ var lines = r . stdout . split ( '\n' ) ;
233231 lines = lines . filter ( function ( line ) {
234232 return ! ( / ^ ( \s + ) a t ( \s + ) < a n o n y m o u s > $ / ) . test ( line ) ;
235233 } ) ;
236- stdout = lines . join ( '\n' ) ;
234+ var stdout = lines . join ( '\n' ) ;
237235
238236 t . same ( stripFullStack ( stdout ) , [
239237 'TAP version 13' ,
@@ -257,7 +255,7 @@ tap.test('async-error', function (t) {
257255 ] ) ;
258256 t . same ( r . exitCode , 1 ) ;
259257
260- var stderr = stripDeprecations ( r . stderr . toString ( 'utf8' ) ) ;
258+ var stderr = stripDeprecations ( r . stderr ) ;
261259 var stderrLines = stderr . split ( '\n' ) . filter ( function ( line ) {
262260 return ! ( / \( t i m e r s .j s : / ) . test ( line )
263261 && ! ( / \( i n t e r n a l \/ t i m e r s .j s : / ) . test ( line )
@@ -271,12 +269,11 @@ tap.test('async-error', function (t) {
271269
272270tap . test ( 'async-bug' , function ( t ) {
273271 runProgram ( 'async-await' , 'async-bug.js' , function ( r ) {
274- var stdout = r . stdout . toString ( 'utf8' ) ;
275- var lines = stdout . split ( '\n' ) ;
272+ var lines = r . stdout . split ( '\n' ) ;
276273 lines = lines . filter ( function ( line ) {
277274 return ! ( / ^ ( \s + ) a t ( \s + ) < a n o n y m o u s > $ / ) . test ( line ) ;
278275 } ) ;
279- stdout = lines . join ( '\n' ) ;
276+ var stdout = lines . join ( '\n' ) ;
280277
281278 t . same ( stripFullStack ( stdout ) , [
282279 'TAP version 13' ,
@@ -301,7 +298,7 @@ tap.test('async-bug', function (t) {
301298 ] ) ;
302299 t . same ( r . exitCode , 1 ) ;
303300
304- var stderr = stripDeprecations ( r . stderr . toString ( 'utf8' ) ) ;
301+ var stderr = stripDeprecations ( r . stderr ) ;
305302
306303 t . same ( stderr , '' ) ;
307304 t . end ( ) ;
0 commit comments