Comments (6)
There is actually already an Elm equivalent in the Time.now task (http://package.elm-lang.org/packages/elm-lang/core/latest/Time#now).
Unfortunately I'm not sure of the best way to incorporate such an Elm specific exercise.
from elm.
... didn't mean to post that quite yet, but I'll continue. :)
Adding the current time as a factor in unit tests makes them quite a bit messier (I'm not sure elm-test) even has provision for incorporation ports/subscriptions/etc. Usually you'd write unit tests against hard coded Time values so that your expected results can also be specified explicitly.
All that is to say that I'm not sure, but I suspect more advanced and Elm specific exercises probably need a home outside of Exercism :)
from elm.
from elm.
from elm.
That's correct, but in the end you'd have essentially the same thing: an incoming message from Elm's Time.now
task or from a subscription to a port returning JS's Date.now()
. I could be wrong, but I don't think elm-test has any way to incorporate these into a test suite.
I'm totally up for ideas! I'm not trying to say "no" (not really my call anyway ;) ), just that I'm not sure how it fits. I'd be curious to see if other tracks actually use the current date in their tests or if they simply hard code specific example tests.
from elm.
I'm sorry that I let this kinda fizzle out. I still think the most correct answer (from a general unit test perspective and an Exercism specific perspective) is to test a predefined set of dates.
I'm closing this to tidy things up. Please feel free to reopen if you want to go over anything else!
from elm.
Related Issues (20)
- Broken link HOT 1
- Overflow issue in the UI HOT 2
- Failed community solutions false positives HOT 10
- Nucleotide Count - Instructions doesn't fully correspond to the task HOT 3
- Strain - Instructions and tests HOT 4
- Available packages HOT 11
- Wording on Luigi's luscious lasagna HOT 7
- The Lasagna exercise is duplicated HOT 3
- Elm logo HOT 4
- exercises: practice: tests: consider implementing some `include = false` tests
- Incorrectly formatted partial application concept header HOT 2
- Extra tag on exercise description HOT 3
- Concept: Opaque types
- Concept: Phantom types
- Discussion: concepts to implement HOT 11
- Concept: Strings HOT 5
- Concept: Random
- Concept: JSON Decoders HOT 6
- Investigate flaky tests
- Concept: *.Extra packages
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 elm.