Skip to content

Commit ceb704c

Browse files
author
Arthur
committed
delete all the sprint 1 file
1 parent 42d4897 commit ceb704c

97 files changed

Lines changed: 101 additions & 7776 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: CodeYourFuture
2+
custom: https://codeyourfuture.io/donate
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Validate PR Metadata
2+
on:
3+
pull_request_target:
4+
types:
5+
- labeled
6+
- unlabeled
7+
- opened
8+
- edited
9+
- reopened
10+
11+
jobs:
12+
validate_pr_metadata:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: CodeYourFuture/actions/validate-pr-metadata@main
17+
with:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.DS_Store
3+
.vscode
4+
**/.DS_Store
5+
.idea
6+
package-lock.json
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"embeddedLanguageFormatting": "auto",
5+
"htmlWhitespaceSensitivity": "css",
6+
"insertPragma": false,
7+
"jsxBracketSameLine": false,
8+
"jsxSingleQuote": false,
9+
"printWidth": 80,
10+
"proseWrap": "preserve",
11+
"quoteProps": "as-needed",
12+
"requirePragma": false,
13+
"semi": true,
14+
"singleQuote": false,
15+
"tabWidth": 2,
16+
"trailingComma": "es5",
17+
"useTabs": false,
18+
"vueIndentScriptAndStyle": false
19+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Fix this implementation
2+
// Start by running the tests for this function
3+
// If you're in the Sprint-1 directory, you can run `npm test -- fix` to run the tests in the fix directory
4+
5+
// Hint: Please consider scenarios when 'list' doesn't have numbers (the function is expected to return null)
6+
// or 'list' has mixed values (the function is expected to sort only numbers).
7+
8+
function calculateMedian(list) {
9+
const middleIndex = Math.floor(list.length / 2);
10+
const median = list.splice(middleIndex, 1)[0];
11+
return median;
12+
}
13+
14+
module.exports = calculateMedian;

Sprint-1/fix/median.test.js renamed to Module-Data-Groups-sprint2-data/Sprint-1/fix/median.test.js

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function dedupe() {}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const dedupe = require("./dedupe.js");
2+
/*
3+
Dedupe Array
4+
5+
📖 Dedupe means **deduplicate**
6+
7+
In this kata, you will need to deduplicate the elements of an array
8+
9+
E.g. dedupe(['a','a','a','b','b','c']) returns ['a','b','c']
10+
E.g. dedupe([5, 1, 1, 2, 3, 2, 5, 8]) returns [5, 1, 2, 3, 8]
11+
E.g. dedupe([1, 2, 1]) returns [1, 2]
12+
*/
13+
14+
// Acceptance Criteria:
15+
16+
// Given an empty array
17+
// When passed to the dedupe function
18+
// Then it should return an empty array
19+
test.todo("given an empty array, it returns an empty array");
20+
21+
// Given an array with no duplicates
22+
// When passed to the dedupe function
23+
// Then it should return a copy of the original array
24+
25+
// Given an array of strings or numbers
26+
// When passed to the dedupe function
27+
// Then it should return a new array with duplicates removed while preserving the
28+
// first occurrence of each element from the original array.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function findMax(elements) {
2+
}
3+
4+
module.exports = findMax;

Sprint-1/implement/max.test.js renamed to Module-Data-Groups-sprint2-data/Sprint-1/implement/max.test.js

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ You should implement this function in max.js, and add tests for it in this file.
99
1010
We have set things up already so that this file can see your function from the other file.
1111
*/
12+
1213
const findMax = require("./max.js");
1314

1415
// Given an empty array
@@ -17,70 +18,6 @@ const findMax = require("./max.js");
1718
// Delete this test.todo and replace it with a test.
1819
test.todo("given an empty array, returns -Infinity");
1920

20-
describe("findMax funtion", () => {
21-
test("given an empty array, returns -Infinity", () => {
22-
const input = [];
23-
const result = findMax(input);
24-
25-
expect(result).toEqual(Infinity);
26-
27-
expect(result).not.toBe(input);
28-
});
29-
30-
test("Given an array with one number ", () => {
31-
const input = [1];
32-
const result = findMax(input);
33-
34-
expect(result).toEqual(1);
35-
36-
expect(result).not.toBe(input);
37-
});
38-
39-
test("Given an array with both positive and negative numbers", () => {
40-
const input = [1, -2];
41-
const result = findMax(input);
42-
43-
expect(result).toEqual(1);
44-
45-
expect(result).not.toBe(input);
46-
});
47-
48-
test("Given an array with just negative numbers", () => {
49-
const input = [-3, -2];
50-
const result = findMax(input);
51-
52-
expect(result).toEqual(-2);
53-
expect(result).not.toBe(input);
54-
});
55-
56-
test(" Given an array with decimal numbers", () => {
57-
const input = [1.23, 1.24];
58-
const result = findMax(input);
59-
60-
expect(result).toEqual(1.24);
61-
62-
expect(result).not.toBe(input);
63-
});
64-
65-
test("Given an array with non-number values", () => {
66-
const input = ["tiger", 1];
67-
const result = findMax(input);
68-
69-
expect(result).toEqual(1);
70-
71-
expect(result).not.toBe(input);
72-
});
73-
74-
test("Given an array with only non-number values", () => {
75-
const input = ["tiger", "bear"];
76-
const result = findMax(input);
77-
78-
expect(result).toEqual(Infinity);
79-
80-
expect(result).not.toBe("input");
81-
});
82-
});
83-
8421
// Given an array with one number
8522
// When passed to the max function
8623
// Then it should return that number

0 commit comments

Comments
 (0)