Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Khazuar committed Aug 19, 2020
1 parent 48cfa37 commit 0bf68cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-mathlive",
"version": "3.0.5-preview",
"version": "3.0.5-preview.1",
"description": "An interactive math input for react.",
"main": "dist/index.js",
"files": [
Expand Down
7 changes: 4 additions & 3 deletions src/MathfieldComponent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
waitForElement,
} from '@testing-library/react';
import { MathfieldComponent, combineConfig } from './MathfieldComponent';
import { Mathfield } from 'mathlive';
// @ts-ignore
import Mathlive from 'mathlive/dist/mathlive';

afterEach(cleanup);

Expand All @@ -19,13 +20,13 @@ describe("combineConfig", () => {
latex: "fubar",
onChange: v => value1 = v,
mathfieldConfig: {
onContentDidChange: mf => value2 = mf.$latex(),
onContentDidChange: (mf: Mathlive.Mathfield) => value2 = mf.$latex(),
},
});

const mockMathField = {
$latex: () => "bar",
} as Mathfield;
} as Mathlive.Mathfield;

combinedConfig.onContentDidChange!(mockMathField);

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"strict": true,
"declaration": true,
"sourceMap": true,
"esModuleInterop": true,
"jsx": "react",
"typeRoots": [
"index.d.ts",
Expand Down

0 comments on commit 0bf68cf

Please sign in to comment.