├── .babelrc ├── .gitignore ├── README.md ├── index.js ├── index.test.js ├── package-lock.json └── package.json /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env"] 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Exercise Starter 2 | 3 | > A starter template for TDD JavaScript exercises, code katas, and interviews 4 | 5 | If you've ever been in a situation where you need to quickly set up a JavaScript project with testing for an interview, exercise or code kata, this template can help you get started in seconds without having to manually initialize and configure a new project. 6 | 7 | ## Install 8 | 9 | ``` 10 | git clone git@github.com:localjo/exercise-starter.git 11 | cd exercise-starter 12 | npm install 13 | ``` 14 | 15 | ## Usage 16 | 17 | Run the test watcher with: 18 | 19 | ``` 20 | npm test 21 | ``` 22 | 23 | Then write your code in index.js and your tests in index.test.js and check the test output in your terminal. 24 | 25 | ## Contribute 26 | 27 | PRs accepted. 28 | 29 | ## License 30 | 31 | MIT © Josiah Sprague 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | export function hello (name = 'World') { 2 | return `Hello, ${name}!`; 3 | } 4 | -------------------------------------------------------------------------------- /index.test.js: -------------------------------------------------------------------------------- 1 | /* eslint-env jest */ 2 | import { hello } from './index'; 3 | 4 | test('Returns greeting', () => { 5 | expect(hello()).toBe('Hello, World!'); 6 | }); 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "exercise-starter", 3 | "version": "1.0.0", 4 | "description": "A starter template for TDD JavaScript exercises, code katas, and interviews", 5 | "keywords": [ 6 | "TDD", 7 | "JavaScript", 8 | "jest", 9 | "starter", 10 | "exercise", 11 | "interview", 12 | "kata" 13 | ], 14 | "main": "index.js", 15 | "scripts": { 16 | "test": "jest --watchAll" 17 | }, 18 | "author": "josiah.sprague@gmail.com", 19 | "license": "MIT", 20 | "devDependencies": { 21 | "babel-core": "^6.26.0", 22 | "babel-jest": "^22.4.3", 23 | "babel-preset-env": "^1.6.1", 24 | "eslint-config-semistandard": "^12.0.1", 25 | "eslint-config-standard": "^11.0.0", 26 | "eslint-plugin-promise": "^3.8.0", 27 | "eslint-plugin-standard": "^3.1.0", 28 | "jest": "^22.4.3", 29 | "regenerator-runtime": "^0.11.1" 30 | }, 31 | "eslintConfig": { 32 | "extends": "eslint-config-semistandard" 33 | } 34 | } 35 | --------------------------------------------------------------------------------