-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Every test of the Advent Of Code #5
Open
brice
wants to merge
14
commits into
main
Choose a base branch
from
test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4c851df
#4 Create test and function in order to make US ready
brice 70cfa1c
fix #4 Get The First star for this issue
brice 38a9c53
#4 Add several test in order to avoid bug
brice 099b3ef
Test related to issue #6
brice c3bd41c
Info #6 Add unit test and change data
brice 2bfe5e2
Info #7 Add new function and test
brice 459d6fc
Change the behavior of a function in #7
brice 4791258
Test for #8 before coding the new bahavior
brice 785a1df
Commit a change in test in order to test array related to #8
brice 031d63c
Reintroduce code from previous days (#10)
brice df58269
Create test for Day 8 (#14)
brice eb30d6e
In order to initiate #15 i will initiate code
brice 8145d39
Merge branch 'main' into test
brice 8a70689
Merge branch 'main' into test
brice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,68 @@ | ||
mocha.setup('tdd'); | ||
|
||
suite('Day One of Advent of Code', () => { | ||
suite('Day one of Advent of Code', () => { | ||
var contentTestInput = ` | ||
1000 | ||
2000 | ||
3000 | ||
|
||
4000 | ||
|
||
5000 | ||
6000 | ||
|
||
7000 | ||
8000 | ||
9000 | ||
|
||
10000`; | ||
|
||
test('The elf with the most calories carry 24000 calories', () => { | ||
chai.expect(getSumOfTopElves(contentTestInput, 1)).to.eql(24000); | ||
}); | ||
|
||
test('The sum of the Calories carried by the top three elves is 45000', () => { | ||
chai.expect(getSumOfTopElves(contentTestInput, 3)).to.eql(45000); | ||
}); | ||
}); | ||
|
||
suite('Day two of Advent of Code', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move this test in a day_2.js file |
||
var strategy = `A Y | ||
B X | ||
C Z | ||
`; | ||
|
||
test('the rock scissor paper score based on the strategy will return 15', () => { | ||
chai.assert.equal(12, getScore(strategy)); | ||
}); | ||
|
||
test('the detailed score should work', () => { | ||
chai.assert.equal(7, getScore('C Z')); | ||
chai.assert.equal(4, getScore('A Y')); | ||
chai.assert.equal(1, getScore('B X')); | ||
chai.assert.equal(3, getScore('A X')); | ||
}); | ||
|
||
test('the rock is valued to 1', () => { | ||
chai.assert.equal(1, getItemValue('A')); | ||
}); | ||
test('the paper is valued to 2', () => { | ||
chai.assert.equal(2, getItemValue('B')); | ||
}); | ||
test('the scissor is valued to 3', () => { | ||
chai.assert.equal(3, getItemValue('C')); | ||
}); | ||
|
||
test('ho no, i lose', () => { | ||
chai.assert.equal(0, getResultScore('X')); | ||
}); | ||
test('this was close', () => { | ||
chai.assert.equal(3, getResultScore('Y')); | ||
}); | ||
test('yeah I win', () => { | ||
chai.assert.equal(6, getResultScore('Z')); | ||
}); | ||
|
||
suite('Day Two of Advent of Code', () => { | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
mocha.setup('tdd'); | ||
|
||
suite('Day eight of Advent of Code', () => { | ||
const testData = `30373 | ||
25512 | ||
65332 | ||
33549 | ||
35390`; | ||
|
||
test('There\'s 21 tree visible from outside the grid', () => { | ||
chai.assert.equal(21, getVisibleTrees(testData)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,4 @@ R 2`; | |
chai.assert.isFalse(iNeedToMoveTail(data[0], data[1])); | ||
}); | ||
}); | ||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this test in a day_1 file.