-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Output lib array opt #562
Output lib array opt #562
Changes from 1 commit
0fb0daa
d4cd76a
d3a3b87
258473f
48646b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = "index"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use strict"; | ||
|
||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
module.exports = function testAssertions(code, stdout, stderr) { | ||
expect(code).toBe(0); | ||
expect(stdout).toEqual(expect.anything()); | ||
expect(stdout[7]).toMatch(/index\.js.*\{0\}/); | ||
expect(stderr).toHaveLength(0); | ||
|
||
const output = fs.readFileSync(path.join(__dirname, "../../../js/bin/output/output-library-many/main.js"), "utf-8"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you abstract this a lil better? Quite long line and slashes that could be trimmed down using |
||
expect(output).toContain("window.key1=window.key1||{},window.key1.key2=function"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe match this assertion using the array indice and regexes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
./index.js | ||
--target async-node | ||
--output-library-target window | ||
--output-library key1 --output-library key2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = "index"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use strict"; | ||
|
||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
module.exports = function testAssertions(code, stdout, stderr) { | ||
expect(code).toBe(0); | ||
expect(stdout).toEqual(expect.anything()); | ||
expect(stdout[7]).toMatch(/index\.js.*\{0\}/); | ||
expect(stderr).toHaveLength(0); | ||
|
||
const output = fs.readFileSync(path.join(__dirname, "../../../js/bin/output/output-library-single/main.js"), "utf-8"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should probably be in an own variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See prev comment 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. se prev comment |
||
expect(output).toContain("window.key1=function"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see prev comment |
||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
./index.js | ||
--target async-node | ||
--output-library-target window | ||
--output-library key1 |
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.