Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
copyright headers
  • Loading branch information
SimenB committed Sep 28, 2022
commit f86074a3f6e38c6c6f3ba476070ad07437fa328d
8 changes: 8 additions & 0 deletions packages/jest-mock/src/__tests__/SuperTestClass.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

export class SuperTestClass {
static staticTestProperty = 'staticTestProperty';

Expand Down
8 changes: 8 additions & 0 deletions packages/jest-mock/src/__tests__/TestClass.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

import {SuperTestClass} from './SuperTestClass';

export default class TestClass extends SuperTestClass {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

import {SuperTestClass} from './SuperTestClass';
import TestClass from './TestClass';
jest.mock('./SuperTestClass');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

import SuperTestClass, {TestClass} from './class-mocks-types';
jest.mock('./class-mocks-types');

Expand Down
8 changes: 8 additions & 0 deletions packages/jest-mock/src/__tests__/class-mocks-types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

export default class SuperTestClass {
static staticTestProperty = 'staticTestProperty';

Expand Down
8 changes: 8 additions & 0 deletions packages/jest-mock/src/__tests__/class-mocks.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

describe('Testing the mocking of a class', () => {
it('can call an instance method', () => {
class TestClass {
Expand Down