Skip to content

Commit 0482fac

Browse files
authored
Merge pull request #161 from jahn96/master
Fix merge conflict
2 parents eb3d75e + fd575d9 commit 0482fac

File tree

5 files changed

+1874
-678
lines changed

5 files changed

+1874
-678
lines changed

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ dist
33
coverage
44
**/*.d.ts
55
test
6-
_temp_extension
6+
_temp_extension
7+
babel.config.ts
8+
jest.config.ts

package.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
"prepare": "jlpm run clean && jlpm run build:prod",
4545
"watch": "run-p watch:src watch:labextension",
4646
"watch:labextension": "jupyter labextension watch .",
47-
"watch:src": "tsc -w"
47+
"watch:src": "tsc -w",
48+
"test": "jest --watch",
49+
"test:cov": "jest --collect-coverage"
4850
},
4951
"dependencies": {
5052
"@jupyterlab/application": "^3.0.3",
@@ -64,13 +66,28 @@
6466
"@lumino/dragdrop": "^1.7.1",
6567
"@lumino/messaging": "^1.4.3",
6668
"@lumino/properties": "^1.2.3",
67-
"@lumino/signaling": "^1.4.3"
69+
"@lumino/signaling": "^1.4.3",
70+
"@lumino/widgets": "^1.13.2"
6871
},
6972
"devDependencies": {
7073
"@jupyterlab/builder": "^3.0.0-rc.13",
7174
"@typescript-eslint/eslint-plugin": "^2.27.0",
7275
"@typescript-eslint/parser": "^2.27.0",
7376
"eslint": "^7.5.0",
77+
"@babel/core": "^7",
78+
"@babel/preset-env": "^7.12.1",
79+
"@babel/preset-react": "^7.12.5",
80+
"@testing-library/react": "^11.1.1",
81+
"@types/enzyme": "^3.10.8",
82+
"@types/enzyme-adapter-react-16": "^1.0.6",
83+
"@types/jest": "^26.0.15",
84+
"@types/node-fetch": "^2.5.7",
85+
"@types/react": "^16.9.56",
86+
"@types/react-dom": "^16.9.9",
87+
"@types/react-test-renderer": "^16.9.3",
88+
"babel-jest": "^26.6.3",
89+
"enzyme": "^3.11.0",
90+
"enzyme-adapter-react-16": "^1.15.5",
7491
"eslint-config-prettier": "^6.10.1",
7592
"eslint-plugin-prettier": "^3.1.2",
7693
"eslint-plugin-react": "^7.20.4",
@@ -82,7 +99,12 @@
8299
"npm-run-all": "^4.1.5",
83100
"prettier": "^1.19.0",
84101
"rimraf": "^3.0.2",
85-
"typescript": "~4.1.3"
102+
"typescript": "~4.1.3",
103+
"react-test-renderer": "^17.0.1",
104+
"ts-jest": "^26.4.4"
105+
},
106+
"resolutions": {
107+
"@types/react": "^16.9.56"
86108
},
87109
"sideEffects": [
88110
"style/*.css",

test/codeSnippetEditor.test.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// start testing code snippet editor
2+
// need to include functions
3+
4+
import React from 'react';
5+
import renderer from 'react-test-renderer';
6+
import { shallow } from 'enzyme';
7+
8+
import { CodeSnippetEditor } from '../src/CodeSnippetEditor';
9+
// import { CodeSnippetDisplay } from '../src/CodeSnippetDisplay';
10+
import { CodeSnippetEditorTags } from '../src/CodeSnippetEditorTags';
11+
// import { Link } from '../src/Link';
12+
13+
14+
interface ICodeSnippetEditorTagProps {
15+
selectedTags: string[];
16+
tags: string[];
17+
handleChange: (selectedTags: string[], allTags: string[]) => void;
18+
};
19+
20+
interface ICodeSnippetEditorTagState {
21+
selectedTags: string[];
22+
tags: string[];
23+
plusIconShouldHide: boolean;
24+
addingNewTag: boolean;
25+
};
26+
27+
describe('jupyterlab/codeSnippetEditor', () => {
28+
29+
})

tsconfig.test.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"es2015.iterable",
1616
"es2017.object"
1717
],
18-
"types": ["jest"],
18+
"types": ["jest", "node"],
1919
"typeRoots": ["./types", "./node_modules/@types"],
2020
"jsx": "react",
2121
"resolveJsonModule": true,
@@ -24,4 +24,4 @@
2424
"skipLibCheck": true
2525
},
2626
"include": ["src/**/*", "test/**/*"]
27-
}
27+
}

0 commit comments

Comments
 (0)