Browse Source

defer jest linting until we are fully switched

Steven Silvester 5 years ago
parent
commit
6146c5e5f9
3 changed files with 28 additions and 30 deletions
  1. 1 2
      .eslintrc.js
  2. 0 1
      package.json
  3. 27 27
      testutils/src/mock.ts

+ 1 - 2
.eslintrc.js

@@ -10,14 +10,13 @@ module.exports = {
     'plugin:@typescript-eslint/eslint-recommended',
     'plugin:@typescript-eslint/recommended',
     'prettier/@typescript-eslint',
-    'plugin:jest/recommended',
     'plugin:react/recommended'
   ],
   parser: '@typescript-eslint/parser',
   parserOptions: {
     project: 'tsconfig.eslint.json'
   },
-  plugins: ['@typescript-eslint', 'jest'],
+  plugins: ['@typescript-eslint'],
   rules: {
     indent: ['error', 2],
     'linebreak-style': ['error', 'unix'],

+ 0 - 1
package.json

@@ -98,7 +98,6 @@
     "@typescript-eslint/parser": "^2.27.0",
     "eslint": "^6.8.0",
     "eslint-config-prettier": "^6.7.0",
-    "eslint-plugin-jest": "^23.8.2",
     "eslint-plugin-prettier": "^3.1.1",
     "eslint-plugin-react": "^7.19.0",
     "husky": "^3.1.0",

+ 27 - 27
testutils/src/mock.ts

@@ -139,8 +139,8 @@ export function cloneKernel(
  * @param model The model of the kernel
  */
 export const KernelMock = jest.fn<
-  Kernel.IKernelConnection,
-  [Private.RecursivePartial<Kernel.IKernelConnection.IOptions>]
+Kernel.IKernelConnection,
+[Private.RecursivePartial<Kernel.IKernelConnection.IOptions>]
 >(options => {
   const model = options.model || {};
   if (!model.id) {
@@ -213,12 +213,12 @@ export const KernelMock = jest.fn<
   };
   // Add signals.
   const iopubMessageSignal = new Signal<
-    Kernel.IKernelConnection,
-    KernelMessage.IIOPubMessage
+  Kernel.IKernelConnection,
+  KernelMessage.IIOPubMessage
   >(thisObject);
   const statusChangedSignal = new Signal<
-    Kernel.IKernelConnection,
-    Kernel.Status
+  Kernel.IKernelConnection,
+  Kernel.Status
   >(thisObject);
   (thisObject as any).statusChanged = statusChangedSignal;
   (thisObject as any).iopubMessage = iopubMessageSignal;
@@ -232,11 +232,11 @@ export const KernelMock = jest.fn<
  * @param model A session model to use
  */
 export const SessionConnectionMock = jest.fn<
-  Session.ISessionConnection,
-  [
-    Private.RecursivePartial<Session.ISessionConnection.IOptions>,
-    Kernel.IKernelConnection | null
-  ]
+Session.ISessionConnection,
+[
+  Private.RecursivePartial<Session.ISessionConnection.IOptions>,
+  Kernel.IKernelConnection | null
+]
 >((options, kernel) => {
   const name = kernel?.name || options.model?.name || KERNEL_MODELS[0].name;
   kernel = kernel || new KernelMock({ model: { name } });
@@ -264,16 +264,16 @@ export const SessionConnectionMock = jest.fn<
     })
   };
   const statusChangedSignal = new Signal<
-    Session.ISessionConnection,
-    Kernel.Status
+  Session.ISessionConnection,
+  Kernel.Status
   >(thisObject);
   const kernelChangedSignal = new Signal<
-    Session.ISessionConnection,
-    Session.ISessionConnection.IKernelChangedArgs
+  Session.ISessionConnection,
+  Session.ISessionConnection.IKernelChangedArgs
   >(thisObject);
   const iopubMessageSignal = new Signal<
-    Session.ISessionConnection,
-    KernelMessage.IIOPubMessage
+  Session.ISessionConnection,
+  KernelMessage.IIOPubMessage
   >(thisObject);
 
   kernel!.iopubMessage.connect((_, args) => {
@@ -296,8 +296,8 @@ export const SessionConnectionMock = jest.fn<
  * @param session The session connection object to use
  */
 export const SessionContextMock = jest.fn<
-  SessionContext,
-  [Partial<SessionContext.IOptions>, Session.ISessionConnection | null]
+SessionContext,
+[Partial<SessionContext.IOptions>, Session.ISessionConnection | null]
 >((options, connection) => {
   const session =
     connection ||
@@ -338,21 +338,21 @@ export const SessionContextMock = jest.fn<
   };
 
   const propertyChangedSignal = new Signal<
-    ISessionContext,
-    'path' | 'name' | 'type'
+  ISessionContext,
+  'path' | 'name' | 'type'
   >(thisObject);
 
   const statusChangedSignal = new Signal<ISessionContext, Kernel.Status>(
     thisObject
   );
   const kernelChangedSignal = new Signal<
-    ISessionContext,
-    Session.ISessionConnection.IKernelChangedArgs
+  ISessionContext,
+  Session.ISessionConnection.IKernelChangedArgs
   >(thisObject);
 
   const iopubMessageSignal = new Signal<
-    ISessionContext,
-    KernelMessage.IIOPubMessage
+  ISessionContext,
+  KernelMessage.IIOPubMessage
   >(thisObject);
 
   session!.statusChanged.connect((_, args) => {
@@ -472,8 +472,8 @@ namespace Private {
   );
 
   export const lastMessageProperty = new AttachedProperty<
-    Kernel.IKernelConnection,
-    string
+  Kernel.IKernelConnection,
+  string
   >({
     name: 'lastMessageId',
     create: () => ''