Skip to content

Commit 6a8a5a4

Browse files
author
Katrina Owen
committed
Import the deprecated JavaScript track
We are deprecating the old JavaScript track, in favor of ECMAScript, which has become the standard. The Exercism website needs to have a git commit that it can point all the existing JavaScript solutions, and we need that commit to be in the repo for the ECMAScript track (soon to be renamed to JavaScript). This commit will do that for us.
1 parent 71d201a commit 6a8a5a4

File tree

428 files changed

+9846
-24032
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

428 files changed

+9846
-24032
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
*.swp
22
.DS_Store
3+
node_modules
34
npm-debug.log
45
tmp
56
bin/configlet
67
bin/configlet.exe
7-
node_modules
88
.idea
9-
babel-output
9+
10+
*.js~

.travis.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
---
21
language: node_js
3-
node_js:
4-
- 'node'
2+
53
sudo: false
6-
before_install:
7-
- npm i -g npm@latest
4+
5+
node_js:
6+
- "lts/*"
7+
88
install:
9-
- npm ci
9+
- "npm install"
10+
1011
script:
11-
- bin/fetch-configlet
12-
- bin/configlet lint .
13-
- make test-travis
12+
- "make test"
13+
- "./bin/fetch-configlet"
14+
- "./bin/configlet lint ."
15+
- "npm run lint"

CONTRIBUTING.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

Makefile

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,25 @@
1-
.DEFAULT_GOAL := test
2-
31
# assignments
42
ASSIGNMENT ?= ""
53
IGNOREDIRS := "^(\.git|docs|bin|node_modules|.idea)$$"
64
ASSIGNMENTS = $(shell find ./exercises -maxdepth 1 -mindepth 1 -type d | cut -d'/' -f3 | sort | grep -Ev $(IGNOREDIRS))
75

86
# output directories
9-
OUTDIR ?= "tmp_exercises/$(ASSIGNMENT)"
7+
TMPDIR ?= "/tmp"
8+
OUTDIR := $(shell mktemp -d "$(TMPDIR)/$(ASSIGNMENT).XXXXXXXXXX")
109

1110
# language specific config (tweakable per language)
1211
FILEEXT := "js"
1312
EXAMPLE := "example.$(FILEEXT)"
1413
TSTFILE := "$(subst _,-,$(ASSIGNMENT)).spec.$(FILEEXT)"
1514

16-
# package.json MD5 hash
17-
SOURCE_PKG_MD5 ?= "`./bin/md5-hash ./package.json`"
18-
PKG_FILES= $(shell find ./exercises/*/* -maxdepth 1 -name package.json)
19-
20-
copy-assignment:
21-
@cp package.json exercises/$(ASSIGNMENT)
22-
@mkdir -p $(OUTDIR)
23-
@cp exercises/grains/lib/big-integer.$(FILEEXT) $(OUTDIR)
15+
test-assignment:
16+
@echo "running tests for: $(ASSIGNMENT)"
17+
@cp big-integer.$(FILEEXT) $(OUTDIR)
2418
@cp exercises/$(ASSIGNMENT)/$(TSTFILE) $(OUTDIR)
2519
@cp exercises/$(ASSIGNMENT)/$(EXAMPLE) $(OUTDIR)/$(subst _,-,$(ASSIGNMENT)).$(FILEEXT)
26-
@sed 's/xtest/test/g' exercises/$(ASSIGNMENT)/$(TSTFILE) > tmp_exercises/$(ASSIGNMENT)/$(TSTFILE)
27-
28-
# To be run as: make test-assignment ASSIGNMENT=hello-world
29-
test-assignment:
30-
$(MAKE) -s copy-assignment
31-
@node_modules/.bin/jest $(OUTDIR)
32-
@rm -rf $(OUTDIR)
33-
34-
test-travis:
35-
@echo "Checking that exercise package.json files match main package.json..."
36-
@for pkg in $(PKG_FILES); do \
37-
! ./bin/md5-hash $$pkg | grep -qv $(SOURCE_PKG_MD5) || { echo "$$pkg does not match main package.json. Please run 'make test' locally and commit the results."; exit 1; }; \
38-
done
39-
@echo "Preparing tests..."
40-
@for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) -s copy-assignment || exit 1; done
41-
@node_modules/.bin/jest --bail $(OUTDIR)
42-
@rm -rf $(OUTDIR)
20+
#@sed -i.original 's/\bxit\b/it/g' $(OUTDIR)/*spec.$(FILEEXT)
21+
@sed 's/xit/it/g' exercises/$(ASSIGNMENT)/$(TSTFILE) > $(OUTDIR)/$(TSTFILE)
22+
@jasmine --random=true $(OUTDIR)/$(TSTFILE)
4323

4424
test:
45-
@echo "Preparing tests..."
46-
@for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) -s copy-assignment || exit 1; node_modules/.bin/jest --bail $(OUTDIR); rm -rf $(OUTDIR); done
25+
@for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) -s test-assignment || exit 1; done

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
# ECMAScript
2-
[![Build Status](https://travis-ci.org/exercism/ecmascript.svg?branch=master)](https://travis-ci.org/exercism/ecmascript)
3-
[![Join the chat at https://gitter.im/exercism/xecmascript](https://badges.gitter.im/exercism/xecmascript.svg)](https://gitter.im/exercism/xecmascript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1+
# DEPRECATION NOTICE
42

5-
Exercism exercises in ECMAScript 6
3+
This track will be deprecated as part of the migration of Exercism to V2. Going forward, the EcmaScript track will replace the JavaScript track as "the new JavaScript" track.
4+
- User's old submissions will be migrated
5+
- PRs unrelated to the deprecation will be closed as `wontfix`
6+
- Issues unrelated to deprecation will be closed as `wontfix`
67

8+
Thank you to all the many invested and hardworking contributors who have helped to make this track a success!!
79

8-
## Running the Unit Test Suite
10+
# JavaScript [![Build Status](https://travis-ci.org/exercism/javascript.svg?branch=master)](https://travis-ci.org/exercism/javascript)[![Join the chat at https://gitter.im/exercism/xecmascript](https://badges.gitter.im/exercism/xecmascript.svg)](https://gitter.im/exercism/xecmascript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
911

10-
[Node.js](https://nodejs.org) must be installed. Follow these [instructions](http://exercism.io/languages/ecmascript/installation) for installing nodejs.
11-
We recommend using the latest LTS version.
12+
Exercism exercises in JavaScript
1213

13-
Use `npm` to install all required dependencies:
14+
## Installing
1415

15-
npm install
16+
To run the tests, you'll need NodeJS and Jasmine. For information about how to install these tools, see the [Javascript](http://exercism.io/languages/javascript/about) page.
1617

17-
#### Linting Your Code
18-
This project uses [eslint](https://github.com/eslint/eslint) to help you write quality
19-
ECMAScript code by checking for common formatting errors, enforcing style rules,
20-
and suggesting changes that conform to best practices.
18+
## Tasks
2119

22-
npm run lint-test
20+
The following commands assume that you are in the `javascript` directory:
2321

24-
#### Test All Assignments
25-
The make script will test all exercises:
22+
### Unit Tests: All Assignments
2623

2724
make test
28-
29-
Note: `make test` is recommended BEFORE submitting a PR. It will test your submission, and help guard against unintentional, unrelated changes.
30-
#### Test Specific Assignment
31-
Pass the exercise name to make script to run the tests for a specific exercise:
3225

33-
make test-assignment ASSIGNMENT=hello-world
34-
26+
### Unit Tests: Single Assignment
27+
28+
make test-assignment ASSIGNMENT=wordy
29+
30+
### Code Style
31+
32+
npm run lint
33+
3534
## Contributing Guide
36-
For an in-depth discussion of how exercism language tracks and exercises work, please see [CONTRIBUTING.md](https://github.com/exercism/ecmascript/blob/master/CONTRIBUTING.md)
35+
36+
Please see the [contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data)
37+

big-integer.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/md5-hash

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)