Skip to content

Commit

Permalink
refactor: use async/await (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Apr 19, 2019
1 parent 8945c7b commit cc4412f
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 180 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ The CLI can exit the process with the following exit codes:
- [svg2ttf](https://github.com/fontello/svg2ttf) - Converts SVG fonts to TTF format.
- [ttf2eot](https://github.com/fontello/ttf2eot) - Converts TTF fonts to EOT format.
- [ttf2woff](https://github.com/fontello/ttf2woff) - Converts TTF fonts to WOFF format.
- [ttf2woff2](https://github.com/nfroidure/ttf2woff2) - Converts TTF fonts to WOFF2.
- [wawoff2](https://github.com/fontello/wawoff2) - Converts TTF fonts to WOFF2 and versa vice.

## Roadmap

Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"eslint-plugin-jest": "^22.4.1",
"eslint-plugin-jsx-a11y": "^6.0.0",
"eslint-plugin-lodash": "^5.1.0",
"eslint-plugin-markdown": "^1.0.0-rc.1",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-react": "^7.1.0",
Expand Down
8 changes: 5 additions & 3 deletions src/__tests__/standalone.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ const fixturesGlob = "src/__tests__/fixtures";

describe("standalone", () => {
it("should throw error if `files` not passed", async () => {
await expect(() => standalone()).toThrow(
"You must pass webfont a `files` glob"
);
try {
await standalone();
} catch (error) {
expect(error.message).toMatch("You must pass webfont a `files` glob");
}
});

it("should throw error `files glob patterns specified did not match any files` if not found files", async () => {
Expand Down
9 changes: 4 additions & 5 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,11 @@ if (cli.flags.version || cli.flags.v) {
}

Promise.resolve()
.then(() =>
Object.assign({}, optionsBase, {
.then(() => {
const options = Object.assign({}, optionsBase, {
files: cli.input
})
)
.then(options => {
});

if (options.files.length === 0) {
cli.showHelp();
}
Expand Down
Loading

0 comments on commit cc4412f

Please sign in to comment.