This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 149
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/cc @sipayRT |
umbobabo
pushed a commit
to umbobabo/gemini
that referenced
this pull request
Jan 16, 2017
Can you write tests on it? And rename please commit by these rules - https://github.com/conventional-changelog/standard-version#commit-message-convention-at-a-glance |
done |
j0tunn
suggested changes
May 16, 2017
@@ -28,7 +28,7 @@ function getDefaultConfig() { | |||
|
|||
function requireModule(file) { | |||
try { | |||
return require(file); | |||
return require(path.resolve(file)); |
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.
в getDefaultConfig
можно тогда убрать path.resolve
test/unit/config/config-reader.js
Outdated
const testData = {some: 'data'}; | ||
const files = {}; | ||
files[fileName] = testData; | ||
const reader = initReader_(files); |
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.
Вот это можно схлопнуть в одну строчку:
const test_ = (fileName) => {
it('should read ' + fileName, () => {
const reader = initReader_({[fileName]: {foo: 'bar'}});
const result = reader.read();
assert.deepEqual(result, {foo: 'bar'});
});
};
И тогда для твоих тестов ты эту функцию можешь сдублировать вместо того, чтобы добавлять в нее логику. Сейчас тест читается трудновато
ping |
Внес правки |
j0tunn
approved these changes
Jun 23, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #704