diff --git a/tutorial/jest.config.js b/tutorial/jest.config.js new file mode 100644 index 0000000..6b56f40 --- /dev/null +++ b/tutorial/jest.config.js @@ -0,0 +1,17 @@ +const path = require('path') + +module.exports = { + rootDir: 'tests', + transform: { + '^.+\\.jsx?$': [ + 'babel-jest', + { configFile: path.resolve(__dirname, 'babel.config.js') }, + ], + }, + transformIgnorePatterns: ['/node_modules/(?!@botonic).+\\.(js|jsx|ts|tsx)$'], + moduleNameMapper: { + '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': + '/__mocks__/fileMock.js', + '\\.(scss|css|less)$': '/__mocks__/styleMock.js', + }, +} diff --git a/tutorial/tests/app.test.js b/tutorial/tests/app.test.js index 6a27d4e..e027bcf 100644 --- a/tutorial/tests/app.test.js +++ b/tutorial/tests/app.test.js @@ -11,11 +11,12 @@ import { routes } from '../src/routes' const app = new NodeApp({ routes, locales, plugins, ...config }) - const input = new BotonicInputTester(app) const output = new BotonicOutputTester(app) test('TEST: (404) NOT FOUND', async () => { const response = await input.text('whatever') - expect(response).toBe(output.text("I don't understand you")) + expect(response).toBe( + output.text('Please, type "start" to start the tutorial.'), + ) })