Skip to content

Glasgow | ITP-Jan-26 | Alasdair MacDonald | Sprint 3 | Coursework 3 implement and rewrite#1157

Open
MacDonald91 wants to merge 7 commits intoCodeYourFuture:mainfrom
MacDonald91:coursework/sprint-3-implement-and-rewrite
Open

Glasgow | ITP-Jan-26 | Alasdair MacDonald | Sprint 3 | Coursework 3 implement and rewrite#1157
MacDonald91 wants to merge 7 commits intoCodeYourFuture:mainfrom
MacDonald91:coursework/sprint-3-implement-and-rewrite

Conversation

@MacDonald91
Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Completed the tasks required on the sprint, completed in one sitting due to catching up on course.

Questions

N/A

@MacDonald91 MacDonald91 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 4, 2026
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exercise has a second part "2 Rewrite tests with Jest" ==> three more files to be updated.

Comment on lines +43 to +47
const numberValue = Number(rank);

if (numberValue >= 2 && numberValue <= 10) {
return numberValue;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In JavaScript, strings that represent valid numeric literals in the language can be safely converted to equivalent numbers. For examples, "0x02", "2.1", or "0002".

Does your function return the value you expected from each of the following function calls?

getCardValue("0x02♠");
getCardValue("2.1♠");
getCardValue("0002♠");

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 11, 2026
@cjyuan
Copy link
Copy Markdown
Contributor

cjyuan commented Apr 17, 2026

This exercise has a second part "2 Rewrite tests with Jest" ==> three more files to be updated.

You also need to update the .test.js file in Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest.

@MacDonald91 MacDonald91 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 17, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 17, 2026
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to revert the change made to package.json in the top-level folder (or else the validation bot will keep complaining).

One way to revert changes to a file is via the git restore command.

First, locate a commit before the file was modified. It could be the first commit you made, assuming the branch started in a clean state.

Next, record the first 7 characters of the commit SHA.

Suppose the file is path/to/file, and you want to restore the file to its state before the commit with SHA 1234567.
The command is:

git restore --source=1234567^ path/to/file

After the file is restored, make a commit and push the changes to GitHub.

} catch (e) {}

// What other invalid card cases can you think of?
>>>>>>> 983743526bc0a40a31b8e20926f23fa3ceb5cf29
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 32, 34, 85 are merge conflict markers.

Lines 33 is from one source and lines 35 to 84 are from another source. You need to

  1. Decide which lines of code you want to keep.
  2. Delete the markers (on the lines I mentioned).

@MacDonald91 MacDonald91 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 19, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 19, 2026
@MacDonald91 MacDonald91 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 19, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 19, 2026
@MacDonald91 MacDonald91 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 19, 2026
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants