Comments (3)
TL:DR; SleeplessByte is correct; I had a stale spec file and didn't know it.
Aha! I see that you changed the test suite ten days ago in PR#649:
exercism/javascript#649
Previously, the spec used an intermediate variable:
const name = '';
expect(twoFer(name)).toEqual("One for you, one for me.")
...which passes ''
to twoFer. Since there is a value present (a blank one), the default value is not triggered.
Now, the spec is:
expect(twoFer()).toEqual("One for you, one for me."
...which passes nothing/undefined to twoFer, and so the default value is triggered.
I had gotten it into my head that the "default value" solution was working for the regular function, but not for the arrow function. But I can't reproduce that behavior now; if I re-test with the older version of the spec, both the "regular" flavor and "arrow" flavor fail, as expected.
So this is definitely an issue caused by me running a stale spec.
Normally, I would depend on Git to tell me whether my local files were stale or not, but in this case since we're using a CLI instead of git, I don't have that guardrail. I'll need to remember to make sure that my specs are up to date before getting further into the weeds on language issues :)
Thanks very much for the rapid input, @SleeplessByte !
from website-copy.
A quick sanity check is to first check your solution page at the bottom for a message that it's outdated. If it's not, then at least in the system you're working against the latest first. Now check the test stuite
tab. If it doesn't match your local file, you're probably using something outdated locally and need to download again!
from website-copy.
Default values always work.
Your test suite is likely outdated (and it's passing in '' instead of "nothing/undefined).
from website-copy.
Related Issues (20)
- Working Locally: add link to info on solving locally
- Prevent people from accidentally comitting comments with unescaped %
- Typos: missing word in configlet description HOT 4
- Mentor Say there is an error in Scala two fer
- "We received the following error when we ran your code:" but no error is following HOT 2
- Irregular spelling ("Focusses" vs "Focuses") on About page.
- Mentor notes layout: Suggested comments should wrap, otherwise not readable HOT 5
- Accessibility : `Publish your code` Dialog not accessible by NVDA screen reader.
- Exercism swag site typo
- Incorrect language counts on login screen
- CLI walkthrough: installing Homebrew on Mac: instructions out of date?
- Typo on 'Get involve in the community' button on dashboard
- Add CLI install via Nix instruction
- Typo on Community page
- analysis of submitted exercise takes unusually long (_still processing_) HOT 2
- During signup: values page mentioned but not linked to
- 79850436079
- Rust/Gigasecond mentoring.md outdated
- Ну HOT 2
- Make complete exercises uncompleted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from website-copy.