Basic JS testing with Jest
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
module.exports = {
presets: ["@babel/preset-env"]
};
export const hello = (name) => `hello ${name}`;
import { hello } from "./index";
describe("works", () => {
it("welcomes you", () => {
expect(hello('Paul')).toEqual('hello Paul');
});
});
{
"private": true,
"version": "0.0.0",
"name": "getting-started-with-jest",
"devDependencies": {
"@babel/core": "*",
"@babel/preset-env": "*",
"babel-jest": "*",
"jest": "*"
},
"scripts": {
"test": "jest"
}
}