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

Support CommonJS #28

Merged
merged 1 commit into from
Jul 24, 2015
Merged

Support CommonJS #28

merged 1 commit into from
Jul 24, 2015

Conversation

gela-d
Copy link
Contributor

@gela-d gela-d commented Jul 16, 2015

Close #17

@gela-d
Copy link
Contributor Author

gela-d commented Jul 16, 2015

@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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

относительные пути нужны при любом значении bundled, так что их получение стоит вынести перед if

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и то верно

@gela-d
Copy link
Contributor Author

gela-d commented Jul 22, 2015

@blond апнула PR c учетом вчерашних и сегодняшних правок.

@@ -29,6 +29,8 @@
"enb": ">= 0.8.22"
},
"devDependencies": {
"chai": "^3.2.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Точные зависимости ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну и must тогда нужно удалить.

@gela-d
Copy link
Contributor Author

gela-d commented Jul 23, 2015

@tadatuta @blond спасибо, все поправила.

}).should.throw(/fake/);
})
.always(function () {
dropRequireCache(require, require.resolve('fake'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Путь до модуля надо строить перед удалением папки node_modules.

@gela-d
Copy link
Contributor Author

gela-d commented Jul 23, 2015

@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);
Copy link
Member

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 — идентичность (===).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Спасибо, поняла.

@blond
Copy link
Member

blond commented Jul 24, 2015

Написал ещё пару замечаний, в остальном 🆗.

@gela-d
Copy link
Contributor Author

gela-d commented Jul 24, 2015

@blond Спасибо, все исправила, все сосквошила.

globals.must.include('node-js');
globals.must.have.length(1);
global.__fake.should.be.equal('fake');
bundle.should.not.contain('module.exports = "fake";');
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blond спасибо за терпение, переделала, обновила, сосквошила.

@blond
Copy link
Member

blond commented Jul 24, 2015

@gela-d теперь тесты падают из-за кодстайла =)

@gela-d
Copy link
Contributor Author

gela-d commented Jul 24, 2015

@blond перезапустила, все ок сейчас

@blond
Copy link
Member

blond commented Jul 24, 2015

👍

blond added a commit that referenced this pull request Jul 24, 2015
@blond blond merged commit 335b51a into master Jul 24, 2015
@blond blond deleted the issues-17 branch July 24, 2015 16:07
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

Successfully merging this pull request may close these issues.

4 participants