Loading…
The API accepts " JavaScript", "javascript" and "JavaScript" as three skills. Clean them up on the server.
Click “Fork” on github.com/Hustlers2Developers/contribution-lab (no access request needed), then clone YOUR fork.
git clone https://github.com/<your-username>/contribution-lab.git
cd contribution-lab
git remote add upstream https://github.com/Hustlers2Developers/contribution-lab.gitYou need Node.js 20+. There is nothing to install. DevCircle runs at http://localhost:3000.
npm test
npm run devIn test/api.test.js, sign up with duplicate and padded skills and expect a clean list back.
it('cleans up skills', async () => {
const res = await signup({ name: 'Ada', email: 'ada2@example.com', username: 'ada-two', password: 'x', skills: [' JS', 'js', 'CSS '] });
assert.deepEqual((await res.json()).member.skills, ['JS', 'CSS']);
});Add a small normaliseSkills(skills) helper (trim, drop empty, keep the first spelling of each skill compared case-insensitively) and use it in POST /api/signup before storing.
The new test passes and no old one breaks.
npm run checkWork on a branch, never on main. `npm run check` runs exactly what CI runs (formatting, tests, profile files); `npm run format` fixes formatting.
git checkout -b task/issue-21
npm run format
npm run check
git add .
git commit -m "trim and de-duplicate skills on signup"
git push -u origin task/issue-21On GitHub click “Compare & pull request”. Write Closes #21 in the description: that links your PR to the task, and the XP is yours when it is merged (the first merged PR completes the task).
Closes #21