Skip to content

Commit cc4412f

Browse files
refactor: use async/await (itgalaxy#182)
1 parent 8945c7b commit cc4412f

File tree

6 files changed

+136
-180
lines changed

6 files changed

+136
-180
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ The CLI can exit the process with the following exit codes:
206206
- [svg2ttf](https://github.com/fontello/svg2ttf) - Converts SVG fonts to TTF format.
207207
- [ttf2eot](https://github.com/fontello/ttf2eot) - Converts TTF fonts to EOT format.
208208
- [ttf2woff](https://github.com/fontello/ttf2woff) - Converts TTF fonts to WOFF format.
209-
- [ttf2woff2](https://github.com/nfroidure/ttf2woff2) - Converts TTF fonts to WOFF2.
209+
- [wawoff2](https://github.com/fontello/wawoff2) - Converts TTF fonts to WOFF2 and versa vice.
210210

211211
## Roadmap
212212

Diff for: package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"eslint-plugin-jest": "^22.4.1",
8383
"eslint-plugin-jsx-a11y": "^6.0.0",
8484
"eslint-plugin-lodash": "^5.1.0",
85-
"eslint-plugin-markdown": "^1.0.0-rc.1",
85+
"eslint-plugin-markdown": "^1.0.0",
8686
"eslint-plugin-node": "^8.0.1",
8787
"eslint-plugin-promise": "^4.1.1",
8888
"eslint-plugin-react": "^7.1.0",

Diff for: src/__tests__/standalone.test.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ const fixturesGlob = "src/__tests__/fixtures";
1111

1212
describe("standalone", () => {
1313
it("should throw error if `files` not passed", async () => {
14-
await expect(() => standalone()).toThrow(
15-
"You must pass webfont a `files` glob"
16-
);
14+
try {
15+
await standalone();
16+
} catch (error) {
17+
expect(error.message).toMatch("You must pass webfont a `files` glob");
18+
}
1719
});
1820

1921
it("should throw error `files glob patterns specified did not match any files` if not found files", async () => {

Diff for: src/cli.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,11 @@ if (cli.flags.version || cli.flags.v) {
342342
}
343343

344344
Promise.resolve()
345-
.then(() =>
346-
Object.assign({}, optionsBase, {
345+
.then(() => {
346+
const options = Object.assign({}, optionsBase, {
347347
files: cli.input
348-
})
349-
)
350-
.then(options => {
348+
});
349+
351350
if (options.files.length === 0) {
352351
cli.showHelp();
353352
}

0 commit comments

Comments
 (0)