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
[WIP] #5 #7
base: master
Are you sure you want to change the base?
[WIP] #5 #7
Conversation
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit should disappear.
@@ -4,3 +4,4 @@ | |||
"add-module-exports" | |||
] | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to this. Please refrain.
@@ -8,7 +8,7 @@ | |||
"test": "test" | |||
}, | |||
"scripts": { | |||
"test": "xo && ava test/**/*.test.js --require babel-register", | |||
"test": "xo && ava test/**/*.test.js --require babel-register --verbose", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If needed to do this, do in a commit only for this, explaining why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, sry.
src/container.js
Outdated
@@ -1,45 +1,44 @@ | |||
const debug = require('debug')('restinga:container'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole file diff is wrong. Editing the container isn't intended. We need to remove it.
src/descriptor.js
Outdated
} | ||
} | ||
module.exports = function ({service, prefix, agent}) { | ||
this.service = service; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do this
in a function.
Prefer to return a object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write a proper name. 'Delete Container', if the case.
Use 'Container' as we're talking about a class.
@@ -1,5 +1,5 @@ | |||
import Request from './request'; | |||
import {Container} from './'; | |||
// import descriptor from './descriptor'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i had already removed the comments on the last commit.
src/resource.js
Outdated
@@ -25,7 +25,8 @@ export default class Resource { | |||
this.collectionRoot = collectionRoot; | |||
this.itemRoot = itemRoot; | |||
|
|||
this.descriptor = Container.get(this.service); | |||
const obj = {service: 'json-placeholder', prefix: 'http://jsonplaceholder.typicode.com', agent: 'restinga-node/1.0.0 (https://github.com/jay-ess/restinga-node)'}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name it const descriptor
to be more clear.
Don't make it a one-liner as it's too big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/resource.js
Outdated
@@ -25,7 +25,8 @@ export default class Resource { | |||
this.collectionRoot = collectionRoot; | |||
this.itemRoot = itemRoot; | |||
|
|||
this.descriptor = Container.get(this.service); | |||
const obj = {service: 'json-placeholder', prefix: 'http://jsonplaceholder.typicode.com', agent: 'restinga-node/1.0.0 (https://github.com/jay-ess/restinga-node)'}; | |||
this.descriptor = obj || null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're not receiving a descriptor from the user, you're mocking one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know, for while.
test/resource.test.js
Outdated
@@ -1,10 +1,10 @@ | |||
import test from 'ava'; | |||
import {Container} from '../src'; | |||
// import {Container} from '../src'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment, again.
test/resource.test.js
Outdated
import {JsonPlaceholderService, PostResource, CommentResource} from './fixtures'; | ||
|
||
const jsonPlaceholderService = new JsonPlaceholderService(); | ||
|
||
Container.register(jsonPlaceholderService); | ||
// Container.register(jsonPlaceholderService); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again.
Don't forget I asked for the commits deletion. |
No description provided.