diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b7abe5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules +.DS_Store + +yarn.lock +yarn-error.log \ No newline at end of file diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 0000000..cedf24f --- /dev/null +++ b/babel.config.json @@ -0,0 +1,5 @@ +{ + "presets": [ + "@babel/preset-env" + ] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..9b19675 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "dependencies": { + "@babel/preset-env": "^7.15.0", + "jest": "^27.0.6" + }, + "scripts": { + "test": "jest" + }, + "name": "tdd-examples", + "version": "1.0.0", + "main": "squareRoot.js", + "devDependencies": {}, + "repository": { + "type": "git", + "url": "git+https://github.com/adekunleoduye/tdd-examples.git" + }, + "author": "Adekunle Oduye", + "license": "ISC", + "bugs": { + "url": "https://github.com/adekunleoduye/tdd-examples/issues" + }, + "homepage": "https://github.com/adekunleoduye/tdd-examples#readme", + "description": "TDD in javascript", + "keywords": [ + "javascript", + "tdd" + ] +} diff --git a/squareRoot.js b/squareRoot.js new file mode 100644 index 0000000..e69de29 diff --git a/squareRoot.test.js b/squareRoot.test.js new file mode 100644 index 0000000..34ba8af --- /dev/null +++ b/squareRoot.test.js @@ -0,0 +1,10 @@ +import squareRoot from 'squareRoot.js' + +describe('Squareroot', () => { + it("Should output number's square", () => { + const acutal = squareRoot(3); + const expected = 9; + + expect(acutal).toEqual(expected); + }) +})