Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change importing in tests on filesObjects #282

Closed
vadim9999 opened this issue May 9, 2019 · 9 comments
Closed

change importing in tests on filesObjects #282

vadim9999 opened this issue May 9, 2019 · 9 comments
Assignees

Comments

@vadim9999
Copy link
Collaborator

vadim9999 commented May 9, 2019

Tests for this task you can find here https://github.com/GroceriStar/sd/tree/master/src/data/__tests__/
In this file tests

cooking_times
cup1
cup1_2
cup1_4
cup1_8
cup3_4
dash
gallon1
pinch
pint1
quart1
tablespoon_1
teaspoon_1

For example in https://github.com/GroceriStar/sd/blob/master/src/data/__tests__/cup1.test.js#L3
is import from files.js. Replace this importing by importing from filesObjects.js that is in root of project.

To import from filesObjects.js you need to use this import

const staticData = require("./filesObjects")
// to get access to allergies use staticData.allergies

staticData contains data of all files that is stored in src/data. staticData is array that contains all objects. Object contains property name - filename, value - object that was got from file.
staticData.allergies returns object.
allergies is a value of property allergies

@vadim9999 vadim9999 changed the title add variables in tests change importing in tests from filesObjects May 9, 2019
@vadim9999 vadim9999 changed the title change importing in tests from filesObjects change importing in tests on filesObjects May 9, 2019
@dctalk1234
Copy link

It appears that the first github link is not working.

@atherdon
Copy link
Contributor

try again, it's about formatting links here

@dctalk1234
Copy link

That worked

@dctalk1234
Copy link

To make sure I'm understanding this right my job is to go through the tests and in for example cup1.test.js file change const {cup1} = require('../../../files.js') to const staticData = require("./filesObjects")

@atherdon
Copy link
Contributor

i'm not Vadim, so cannot reply to you exactly. Make your changes, show you code and when we will be ready - he will tell you if you need to change something in your code ;)

@atherdon
Copy link
Contributor

Btw, some our other developer, Ebrahim also show interest to make some changes in tests - so be aware about it - because your changes can generate a conflict with his code

@atherdon
Copy link
Contributor

did we finish this task?

@atherdon
Copy link
Contributor

@Edebo can you grab this task too?

@Edebo Edebo mentioned this issue May 20, 2019
14 tasks
@atherdon
Copy link
Contributor

it's done

@atherdon atherdon added this to the Testing & Tests milestone May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants