diff --git a/exercises/exercise2/testPresidents.js b/exercises/exercise2/testPresidents.js new file mode 100644 index 0000000000000000000000000000000000000000..a767c67cbbddeeb9a7e0dd4f7b75b57ed73bb244 --- /dev/null +++ b/exercises/exercise2/testPresidents.js @@ -0,0 +1,4 @@ +// Make a smaller array of the test data to run on +// and export it +// e.g. 3 presidents born in the 1800's , 2 in the pre 1800's and 1 post 1800's + diff --git a/exercises/exercise2/tests.js b/exercises/exercise2/tests.js new file mode 100644 index 0000000000000000000000000000000000000000..fdea62234afc4c19b5160eaacbd9514869c582a4 --- /dev/null +++ b/exercises/exercise2/tests.js @@ -0,0 +1,13 @@ +// import data from testData.js and assign it to a variable + +function testFilter(testData, expectedData) { + let result = testData.filter() + if (result === expectedData) { + console.log('filter passed') + } else { + // can also throw an error + console.log('filter failed') + } +} + +testFilter() \ No newline at end of file