Skip to content

Commit

Permalink
fix: 🐛 postcss installation check
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisermann committed Jul 7, 2020
1 parent ac4c954 commit 7df673a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/hasDepInstalled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ const cachedResult: Record<string, boolean> = {};

export async function hasDepInstalled(dep: string) {
if (cachedResult[dep] != null) {
return cachedResult;
return cachedResult[dep];
}

let result = false;

try {
await import(dep);

result = true;
} catch (e) {
console.log(e);
result = false;
}

Expand Down
3 changes: 3 additions & 0 deletions test/transformers/babel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const BABEL_CONFIG = {
],
};

beforeAll(() => jest.setTimeout(10000));
afterAll(() => jest.setTimeout(5000));

describe('transformer - babel', () => {
it('transpiles with babel', async () => {
const template = `<script>
Expand Down

0 comments on commit 7df673a

Please sign in to comment.