-
Notifications
You must be signed in to change notification settings - Fork 344
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
Name a zipped extension file based on manifest #66
Conversation
kumar303
commented
Feb 24, 2016
- Fixes Name built xpi according to manifest #37 (manifest naming)
- Fixes Do basic manifest validation #34 (basic manifest validation)
- Fixes Exit non-zero upon exception #36 (program exit)
@rpl would you have time to review this? I'll send an email with some details. |
659cd70
to
0499c7b
Compare
|
||
return withTempDir( | ||
(tmpDir) => | ||
adapter.buildMinimalExt(tmpDir) |
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.
Proposal: How about introducing co (at least in the test cases, because, in my own opinion, currently the implementation is clear enough even with the use of plain Promises) to get nicer async code?
as an example this test case could be turned into something like:
it('zips a package', () => withTempDir(
(tmpDir) =>
co(function*() {
let zipFile = new ZipFile();
let {extensionPath} = yield adapter.buildMinimalExt(tmpDir);
assert.match(extensionPath, /minimal_extension-1\.0\.xpi$/);
yield zipFile.open(extensionPath);
let fileNames = [];
yield zipFile.readEach((entry) => fileNames.push(entry.fileName));
assert.deepEqual(fileNames, ['manifest.json']);
})
));
and as a plus: this mostly matches to our current coding style for async tests in the Firefox source code (e.g. what is achieved in the test suites using add_task and Task.async
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.
omgyes! This is way more concise. I think we should convert the entire code base to this so I filed an issue for it: #72
@kumar303 Thanks a lot for asking me to review this, it was an helpful way to start to look into the internals of the newborn tool :-) I found the code very clean and readable, then I haven't too much to add (just a couple of proposal and nits, that I hope can be useful) 👍 |
}); | ||
|
||
|
||
function writeManifest(destDir, manifestData) { |
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.
Nit, how about moving this helper in tests/helpers.js
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.
The reason I didn't was because I'm not sure any other test will need this helper function. All other tests should be able to work directly with manifest objects.
Name a zipped extension file based on manifest