almai
2/1/2019 - 2:08 PM

Simple unit test that tests if a string contains another string


export function greet(name) {
  return 'Welcome ' + name;
}
import { greet } from './greet';

describe('.greet()', () => {
  it('should include the name in the greeting', () => {
    const greeting = greet('Bruce Wayne');

    expect(greeting).toContain(name);
  });
});