-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support CommonJS #28
Support CommonJS #28
Conversation
@blond у меня сильные сомнения по поводу теста https://github.com/enb-make/enb-diverse-js/pull/28/files#diff-b57fdf30ce49f0637363fc0c68699588R129 |
bundled = this._bundled || ''; | ||
|
||
if (bundled) { | ||
var files = sourceFiles.map(function (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.
относительные пути нужны при любом значении bundled
, так что их получение стоит вынести перед if
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.
@tadatuta почему? Мы же их используем только в контексте этой опции.
UPD: все, поняла, вынесу.
UPD2: как я могу их вынести, если у меня в каждом map используется file.fullname
?
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.
и то верно
@blond апнула PR c учетом вчерашних и сегодняшних правок. |
@@ -29,6 +29,8 @@ | |||
"enb": ">= 0.8.22" | |||
}, | |||
"devDependencies": { | |||
"chai": "^3.2.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.
Точные зависимости ;)
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.
Ну и must
тогда нужно удалить.
}).should.throw(/fake/); | ||
}) | ||
.always(function () { | ||
dropRequireCache(require, require.resolve('fake')); |
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.
Путь до модуля надо строить перед удалением папки node_modules
.
@blond исправила замечания |
@@ -26,7 +30,7 @@ describe('browser-js', function () { | |||
|
|||
return build(blocks) | |||
.then(function (content) { | |||
content[0].must.be(reference); | |||
content[0].should.be.eql(reference); |
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.
should.be.eql
-> should.be.equal
Это разные операции сравнения. equal
— идентичность (===), eql
— глубокая эквивалентность (deepEqual).
Было must.be
— идентичность (===).
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.
Спасибо, поняла.
Написал ещё пару замечаний, в остальном 🆗. |
@blond Спасибо, все исправила, все сосквошила. |
globals.must.include('node-js'); | ||
globals.must.have.length(1); | ||
global.__fake.should.be.equal('fake'); | ||
bundle.should.not.contain('module.exports = "fake";'); |
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.
Такая проверка ничего не гаранитрует. Да и проверять 2 кейса в одном тесте не ок.
Предлагаю убрать эту проверку из этого теста, переименовать его в must use CommonJS module
, а последний тест must fail if node_modules does not exist
переименовать в must not reveal node_modules
.
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.
@blond спасибо за терпение, переделала, обновила, сосквошила.
@gela-d теперь тесты падают из-за кодстайла =) |
@blond перезапустила, все ок сейчас |
👍 |
Close #17