From 24a8f2e0c27f8a03ca85aad6bf5216c4e664076a Mon Sep 17 00:00:00 2001 From: Adekunle Oduye Date: Wed, 25 Aug 2021 22:46:57 -0400 Subject: [PATCH] feat: square root failing test --- .gitignore | 5 +++++ babel.config.json | 5 +++++ package.json | 28 ++++++++++++++++++++++++++++ squareRoot.js | 0 squareRoot.test.js | 10 ++++++++++ 5 files changed, 48 insertions(+) create mode 100644 .gitignore create mode 100644 babel.config.json create mode 100644 package.json create mode 100644 squareRoot.js create mode 100644 squareRoot.test.js 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); + }) +})