├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── index.js ├── jest.config.js ├── other ├── create-node-runner │ ├── index.js │ ├── node-runner.js │ └── require-module.js ├── jest.config.js └── jest.no-framework.config.js ├── package.json └── src ├── __mocks__ └── utils.js ├── __no-framework-mocks__ └── utils.js ├── __tests__ ├── external-mock-module.js ├── inline-module-mock.js ├── mock-fn.js └── spy.js ├── no-framework ├── external-mock-module.js ├── inline-module-mock.js ├── mock-fn.js ├── monkey-patching.js └── spy.js ├── thumb-war.js └── utils.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .eslintcache 3 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/CONTRIBUTING.md -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/LICENSE.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/README.md -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // see the tests 2 | 3 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/jest.config.js -------------------------------------------------------------------------------- /other/create-node-runner/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/other/create-node-runner/index.js -------------------------------------------------------------------------------- /other/create-node-runner/node-runner.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/other/create-node-runner/node-runner.js -------------------------------------------------------------------------------- /other/create-node-runner/require-module.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/other/create-node-runner/require-module.js -------------------------------------------------------------------------------- /other/jest.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/other/jest.config.js -------------------------------------------------------------------------------- /other/jest.no-framework.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/other/jest.no-framework.config.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/package.json -------------------------------------------------------------------------------- /src/__mocks__/utils.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | getWinner: jest.fn((p1, p2) => p1) 3 | } 4 | -------------------------------------------------------------------------------- /src/__no-framework-mocks__/utils.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/__no-framework-mocks__/utils.js -------------------------------------------------------------------------------- /src/__tests__/external-mock-module.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/__tests__/external-mock-module.js -------------------------------------------------------------------------------- /src/__tests__/inline-module-mock.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/__tests__/inline-module-mock.js -------------------------------------------------------------------------------- /src/__tests__/mock-fn.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/__tests__/mock-fn.js -------------------------------------------------------------------------------- /src/__tests__/spy.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/__tests__/spy.js -------------------------------------------------------------------------------- /src/no-framework/external-mock-module.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/no-framework/external-mock-module.js -------------------------------------------------------------------------------- /src/no-framework/inline-module-mock.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/no-framework/inline-module-mock.js -------------------------------------------------------------------------------- /src/no-framework/mock-fn.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/no-framework/mock-fn.js -------------------------------------------------------------------------------- /src/no-framework/monkey-patching.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/no-framework/monkey-patching.js -------------------------------------------------------------------------------- /src/no-framework/spy.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/no-framework/spy.js -------------------------------------------------------------------------------- /src/thumb-war.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/thumb-war.js -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentcdodds/js-mocking-fundamentals/HEAD/src/utils.js --------------------------------------------------------------------------------