Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Using Moment.js or something similar #119

Open
bondsgame101 opened this issue Dec 27, 2018 · 3 comments
Open

Using Moment.js or something similar #119

bondsgame101 opened this issue Dec 27, 2018 · 3 comments

Comments

@bondsgame101
Copy link

I am trying to dynamically produce the current day in a test. Faker will not allow me to format for the required post data that I need. I know of moment.js and day.js that will produce this and allow me to format the data. I have not been able to successfully import either into my test and was wondering if import was possible, if there was something else already built in, or if this is something that could possibly added as feature?

@jgroom33
Copy link
Collaborator

the project uses nunjucks. Looks like there is a filter for moment.js: https://www.npmjs.com/package/nunjucks-date-filter

@jgroom33
Copy link
Collaborator

This would need to be added to the project. There isn't currently a way to import libs.
It should be a pretty simple addition to the project. Here's where the dateFilter could be added to the nunjucks env: https://github.com/eykrehbein/strest/blob/master/src/test.ts#L40

@shrikster
Copy link
Contributor

I can take this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants