Skip to content

Commit

Permalink
Begin porting to TypeScript (#183)
Browse files Browse the repository at this point in the history
* feat: Add TypeScript support

* chore: Reference the package absolutely when testing

* fix(eslint): Ignore compiled output

* fix(eslint): Ignore root index.* files

* fix: Clean up old build artifacts, update Prettier
  • Loading branch information
AverageHelper authored Jan 3, 2024
1 parent b199133 commit 37718b1
Show file tree
Hide file tree
Showing 41 changed files with 14,139 additions and 26,464 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"root": true,
"ignorePatterns": ["dist", "node_modules"],
"ignorePatterns": ["mocks", "index.*", "dist", "node_modules"],
"extends": ["@upstatement", "plugin:jest/recommended"],
"plugins": ["jest"],
"parserOptions": {
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ yarn-error.log*
# Jest
/coverage
server/coverage

# Build artifacts
/mocks
/index.*
70 changes: 36 additions & 34 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions __tests__/auth.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { mockFirebase } = require('firestore-jest-mock');
const { mockInitializeApp } = require('../mocks/firebase');
const { mockInitializeApp } = require('firestore-jest-mock/mocks/firebase');
const {
mockCreateUserWithEmailAndPassword,
mockSignInWithEmailAndPassword,
Expand All @@ -11,7 +11,7 @@ const {
mockCreateCustomToken,
mockSetCustomUserClaims,
mockUseEmulator,
} = require('../mocks/auth');
} = require('firestore-jest-mock/mocks/auth');

describe('we can start a firebase application', () => {
mockFirebase({
Expand Down
4 changes: 2 additions & 2 deletions __tests__/full-setup-library-firestore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe.each([
const FirestoreMock = require('firestore-jest-mock');

const flushPromises = () => new Promise(setImmediate);
const { Timestamp } = require('../mocks/timestamp');
const { Timestamp } = require('firestore-jest-mock/mocks/timestamp');
const {
mockGet,
mockSelect,
Expand All @@ -23,7 +23,7 @@ describe.each([
mockOnSnapShot,
mockListCollections,
mockTimestampNow,
} = require('../mocks/firestore');
} = require('firestore-jest-mock/mocks/firestore');

describe('we can start a firestore application', () => {
FirestoreMock[mockFunction]({
Expand Down
6 changes: 3 additions & 3 deletions __tests__/full-setup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ describe.each`

jest.resetModules();
const { mockFirebase } = require('firestore-jest-mock');
const { mockInitializeApp } = require('../mocks/firebase');
const { mockInitializeApp } = require('firestore-jest-mock/mocks/firebase');

const flushPromises = () => new Promise(setImmediate);
const { Timestamp } = require('../mocks/timestamp');
const { Timestamp } = require('firestore-jest-mock/mocks/timestamp');
const {
mockGet,
mockSelect,
Expand All @@ -34,7 +34,7 @@ describe.each`
FakeFirestore,
mockQueryOnSnapshot,
mockTimestampNow,
} = require('../mocks/firestore');
} = require('firestore-jest-mock/mocks/firestore');

mockFirebase(
{
Expand Down
2 changes: 1 addition & 1 deletion __tests__/mock-fieldvalue.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
mockDeleteFieldValue,
mockIncrementFieldValue,
mockServerTimestampFieldValue,
} = require('../mocks/firestore');
} = require('firestore-jest-mock/mocks/firestore');

describe('Single values transformed by field sentinels', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/path.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { mockFirebase } = require('firestore-jest-mock');
mockFirebase({ database: {} });
const firebase = require('firebase');
const path = require('../mocks/path');
const path = require('firestore-jest-mock/mocks/path');

describe('Single values transformed by field sentinels', () => {
test('isEqual', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {
mockWhere,
mockOffset,
FakeFirestore,
} = require('../mocks/firestore');
} = require('firestore-jest-mock/mocks/firestore');
const { mockFirebase } = require('firestore-jest-mock');

describe('Queries', () => {
Expand Down
13 changes: 0 additions & 13 deletions index.js

This file was deleted.

Loading

0 comments on commit 37718b1

Please sign in to comment.