-
Notifications
You must be signed in to change notification settings - Fork 4
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
format_tests #53
base: master
Are you sure you want to change the base?
format_tests #53
Conversation
package.json
Outdated
"uniq": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.16.0", | ||
"eslint-config-pedant": "^0.8.0", | ||
"mocha": "^3.1.0", | ||
"rimraf": "^2.5.4" | ||
"proxyquire": "^2.0.1", |
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.
- "proxyquire": "^2.0.1",
- "sinon": "^4.4.8"
var isPiped = template instanceof stream.Readable, | ||
content = (isPiped || typeof template === 'string') ? template : | ||
template(entity, bemNaming(options.naming)), | ||
var isPiped = content instanceof stream.Readable, |
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.
useless
also try to use createTree
for all
test/test1.js
Outdated
|
||
function testEntityHelper(entities, levels, techs, options, expected) { | ||
const actualPaths = prepareEntityData(entities, levels, techs, options) | ||
.map(({ path }) => path) |
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.
- .map(({ path }) => path)
+ .map(item => item.path)
and remove eslint rule
lib/prepare-entity-data.js
Outdated
levelOptions.forceRewrite = options.forceRewrite; | ||
} | ||
|
||
return { |
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.
most likely there's no need to tunnel all the fields here.
try to get it directly from global opts (maybe there's some common computation so it could be one more additional module).
9e33dc2
to
69fc5aa
Compare
69fc5aa
to
503416a
Compare
var levelsMap = config.levelMapSync(), | ||
levelList = Object.keys(levelsMap); | ||
|
||
var defaultLevels = levelList.filter(function(level) { |
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.
возможно, нужно вычислять только после levelByCwd, потому что на строке https://github.com/bem-tools/bem-tools-create/pull/53/files#diff-d854c73a37caf2bcd71fe93eba02959fR40 стоит справа от или
|
||
var levelByCwd = levelList.filter(function(level) { | ||
return cwd.indexOf(level) === 0; | ||
}).sort().reverse()[0]; |
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.
затащить reverse внутрь sort
No description provided.