first commit
This commit is contained in:
17
test.js
Normal file
17
test.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import chalk from 'chalk';
|
||||
import test from 'ava';
|
||||
import {render} from 'ink-testing-library';
|
||||
import App from './source/app.js';
|
||||
|
||||
test('greet unknown user', t => {
|
||||
const {lastFrame} = render(<App />);
|
||||
|
||||
t.is(lastFrame(), `Hello, ${chalk.green('Stranger')}`);
|
||||
});
|
||||
|
||||
test('greet user with a name', t => {
|
||||
const {lastFrame} = render(<App name="Jane" />);
|
||||
|
||||
t.is(lastFrame(), `Hello, ${chalk.green('Jane')}`);
|
||||
});
|
||||
Reference in New Issue
Block a user