Skip to content

Commit 20b144b

Browse files
committed
Ignore startup message
1 parent e5149c9 commit 20b144b

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

lib/node_modules/@stdlib/repl/server/test/test.cli.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,26 @@ tape( 'the command-line interface spawns a REPL', opts, function test( t ) {
156156
child.stdin.end();
157157

158158
expected = [
159-
'Starting REPL...',
160159
'> Printing to console...',
161160
'> 9',
162161
'> '
163162
].join( '\n' );
164163

165164
function done( error, stdout, stderr ) {
166165
var str;
166+
var i;
167167
if ( error ) {
168168
t.fail( error.message );
169169
} else {
170170
str = stdout.toString();
171+
i = 0;
172+
while ( i < str.length ) {
173+
if ( str[ i ] === '>' ) {
174+
break;
175+
}
176+
i += 1;
177+
}
178+
str = str.substring( i );
171179
t.strictEqual( str, expected, 'prints output to `stdout`' );
172180
t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' );
173181
}

lib/node_modules/@stdlib/repl/test/test.cli.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,26 @@ tape( 'the command-line interface spawns a REPL', opts, function test( t ) {
156156
child.stdin.end();
157157

158158
expected = [
159-
'Starting REPL...',
160159
'> Printing to console...',
161160
'> 9',
162161
'> '
163162
].join( '\n' );
164163

165164
function done( error, stdout, stderr ) {
166165
var str;
166+
var i;
167167
if ( error ) {
168168
t.fail( error.message );
169169
} else {
170170
str = stdout.toString();
171+
i = 0;
172+
while ( i < str.length ) {
173+
if ( str[ i ] === '>' ) {
174+
break;
175+
}
176+
i += 1;
177+
}
178+
str = str.substring( i );
171179
t.strictEqual( str, expected, 'prints output to `stdout`' );
172180
t.strictEqual( stderr.toString(), '', 'does not print to `stderr`' );
173181
}

0 commit comments

Comments
 (0)