Skip to content

Commit

Permalink
Fix tests and reinstate running them
Browse files Browse the repository at this point in the history
  • Loading branch information
securingsincity committed Mar 24, 2024
1 parent 15717ff commit 9e93c71
Show file tree
Hide file tree
Showing 5 changed files with 1,266 additions and 726 deletions.
3 changes: 2 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type {Config} from 'jest';

const config: Config = {
testEnvironment: "jsdom",
coverageReporters: ["html", "text", "lcov"]
coverageReporters: ["html", "text", "lcov"],
reporters: ["default", "summary"],
};

export default config;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"prettier": "prettier --write \"src/**\" \"example/*.js\"",
"prettier": "prettier --write \"src/**\" \"example/*.js\" \"tests/**\"",
"clean": "rimraf lib dist",
"lint": "echo 'foo'",
"build:lib": "tsc",
Expand All @@ -18,8 +18,8 @@
"preversion": "npm run clean && npm run check",
"version": "npm run build",
"prepublishOnly": "npm run clean && npm run build",
"test": "echo 'jest'",
"coverage": "nyc npm run test",
"test": "jest",
"coverage": "jest --coverage",
"prepare": "npm run build:lib"
},
"author": "James Hrisho",
Expand Down
11 changes: 4 additions & 7 deletions src/split.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import {
} from "./editorOptions";
const ace = getAceInstance();
import { Ace, Range } from "ace-builds";
import Editor = Ace.Editor;
import { Split } from "ace-builds/src-noconflict/ext-split";
import * as PropTypes from "prop-types";
import * as React from "react";
const isEqual = require("lodash.isequal");
const get = require("lodash.get");
import {
IAceEditor,
IAceOptions,
IAnnotation,
ICommand,
IEditorProps,
IMarker
} from "./types";

interface IAceEditorClass extends Editor {
interface IAceEditorClass extends IAceEditor {
[index: string]: any;
$options?: any;
}
Expand Down Expand Up @@ -75,10 +75,7 @@ export interface ISplitEditorProps {
markers?: IMarker[][];
}

export default class SplitComponent extends React.Component<
ISplitEditorProps,
undefined
> {
export default class SplitComponent extends React.Component<ISplitEditorProps> {
[index: string]: any;

public static propTypes: PropTypes.ValidationMap<ISplitEditorProps> = {
Expand Down Expand Up @@ -209,7 +206,7 @@ export default class SplitComponent extends React.Component<
splits
} = this.props;

this.editor = ace.edit(this.refEditor);
this.editor = ace.edit(this.refEditor) as IAceEditor;
if (this.isInShadow(this.refEditor)) {
this.editor.renderer.attachToShadowRoot();
}
Expand Down

0 comments on commit 9e93c71

Please sign in to comment.