Skip to content
项目

关于

Exercism 的 JavaScript 练习。

学习与教育

这些数字如何统计

实测星标增长

24小时
-1
7天
0
15天
+1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Exercism JavaScript Track

Configlet javascript / main

[!IMPORTANT] We 💙 our community but this repository does not accept community contributions at this time.
There are no active maintainers to review PRs.
Please read this community blog post for details.

Exercism exercises in JavaScript

This is the JavaScript track, one of the many tracks on Exercism. It holds all the exercises that are currently implemented and available for students to complete. The track consists of various concept exercises that teach the JavaScript syllabus, and various practice exercises, which are unlocked by progressing in the syllabus and can be used to practice concepts learned. You can find this in the config.json.

Tools

See CONTRIBUTING.md for a list of requirements to contribute to this track. It also has a list of tools you can use, of which the test tool is one of them.

Running the code quality tooling (linter)

This runs eslint for all files that require linting.

corepack pnpm node scripts/lint.mjs --fix

These are also the files that are linted using the lint script, mentioned in CONTRIBUTING.md. The lint rules imposed on contributors and maintainers are stricter than those for the student. The idea is that we do not impose style rules on the students, but we guard for (potential) errors.

Files with strict rules:

  • <slug>.spec.js
  • .meta/proof.ci.js
  • .meta/exemplar.js

Files with loose rules:

  • custom.spec.js
  • <slug>.js

Running the test suite

This runs jest tests for all sample solutions. This does not use the regular way to run jest, because the example solution files must be renamed to be imported correctly into the test files.

corepack pnpm node scripts/test.mjs

If the ASSIGNMENT environment variable is set, only that exercise is tested. For example, if you only want to test the example.js for the practice exercise two-fer, you may, depending on your environment, use:

ASSIGNMENT=practice/two-fer corepack pnpm node scripts/test.mjs

Running on Windows? Depending on your shell, environment variables are set differently. You can use cross-env to normalize this. The following should work across environments:

# if installed globally
cross-env ASSIGNMENT=practice/two-fer corepack pnpm node scripts/test.mjs

# otherwise
corepack pnpm dlx cross-env ASSIGNMENT=practice/two-fer node scripts/test.mjs

Related repositories

Related TypeScript repositories

A lot of the improvements made to this track and tooling are also made to the TypeScript track and tooling and vice-versa.

探索相关项目

加载中…