Skip to content

Commit 485894a

Browse files
authored
feat: add @expo/entity-testing-utils package (#280)
1 parent 1da5cc0 commit 485894a

File tree

112 files changed

+1295
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1295
-189
lines changed

.ctirc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
],
1919
"exclude": [
2020
"**/*tests__/**",
21-
"**/testfixtures/**"
21+
"**/__testfixtures__/**"
2222
],
2323
"output": "src"
2424
}

codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ codecov:
33
ignore:
44
- "packages/entity-example"
55
- "packages/entity-codemod"
6+
- "packages/entity-testing-utils"

packages/entity-cache-adapter-local-memory/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"lru-cache": "^6.0.0"
3232
},
3333
"devDependencies": {
34+
"@expo/entity-testing-utils": "workspace:^",
3435
"@types/jest": "^29.5.12",
3536
"@types/lru-cache": "^5.1.1",
3637
"@types/node": "^20.14.1",
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import {
22
NoOpEntityMetricsAdapter,
33
IEntityMetricsAdapter,
44
EntityCompanionProvider,
5-
StubQueryContextProvider,
6-
StubDatabaseAdapterProvider,
75
} from '@expo/entity';
6+
import { StubDatabaseAdapterProvider, StubQueryContextProvider } from '@expo/entity-testing-utils';
87

98
import LocalMemoryCacheAdapterProvider from '../LocalMemoryCacheAdapterProvider';
109

packages/entity-cache-adapter-local-memory/src/__tests__/GenericLocalMemoryCacher-full-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import GenericLocalMemoryCacher from '../GenericLocalMemoryCacher';
1313
import LocalMemoryCacheAdapterProvider from '../LocalMemoryCacheAdapterProvider';
1414
import LocalMemoryTestEntity, {
1515
LocalMemoryTestEntityFields,
16-
} from '../testfixtures/LocalMemoryTestEntity';
16+
} from '../__testfixtures__/LocalMemoryTestEntity';
1717
import {
1818
createLocalMemoryTestEntityCompanionProvider,
1919
createNoOpLocalMemoryIntegrationTestEntityCompanionProvider,
20-
} from '../testfixtures/createLocalMemoryTestEntityCompanionProvider';
20+
} from '../__testfixtures__/createLocalMemoryTestEntityCompanionProvider';
2121

2222
describe(GenericLocalMemoryCacher, () => {
2323
it('has correct caching behavior', async () => {

packages/entity-cache-adapter-redis/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
},
3535
"devDependencies": {
3636
"@expo/batcher": "^1.0.0",
37+
"@expo/entity-testing-utils": "workspace:^",
3738
"@types/jest": "^29.5.12",
3839
"@types/node": "^20.14.1",
3940
"ctix": "^2.7.0",

packages/entity-cache-adapter-redis/src/__integration-tests__/BatchedRedisCacheAdapter-integration-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import GenericRedisCacher, {
1818
GenericRedisCacheContext,
1919
RedisCacheInvalidationStrategy,
2020
} from '../GenericRedisCacher';
21-
import RedisTestEntity, { RedisTestEntityFields } from '../testfixtures/RedisTestEntity';
22-
import { createRedisIntegrationTestEntityCompanionProvider } from '../testfixtures/createRedisIntegrationTestEntityCompanionProvider';
21+
import RedisTestEntity, { RedisTestEntityFields } from '../__testfixtures__/RedisTestEntity';
22+
import { createRedisIntegrationTestEntityCompanionProvider } from '../__testfixtures__/createRedisIntegrationTestEntityCompanionProvider';
2323

2424
class BatchedRedis implements IRedis {
2525
private readonly mgetBatcher = new Batcher<string[], (string | null)[]>(

packages/entity-cache-adapter-redis/src/__integration-tests__/GenericRedisCacher-full-integration-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import GenericRedisCacher, {
1515
GenericRedisCacheContext,
1616
RedisCacheInvalidationStrategy,
1717
} from '../GenericRedisCacher';
18-
import RedisTestEntity, { RedisTestEntityFields } from '../testfixtures/RedisTestEntity';
19-
import { createRedisIntegrationTestEntityCompanionProvider } from '../testfixtures/createRedisIntegrationTestEntityCompanionProvider';
18+
import RedisTestEntity, { RedisTestEntityFields } from '../__testfixtures__/RedisTestEntity';
19+
import { createRedisIntegrationTestEntityCompanionProvider } from '../__testfixtures__/createRedisIntegrationTestEntityCompanionProvider';
2020

2121
class TestViewerContext extends ViewerContext {}
2222

packages/entity-cache-adapter-redis/src/__integration-tests__/GenericRedisCacher-integration-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import GenericRedisCacher, {
99
import RedisTestEntity, {
1010
redisTestEntityConfiguration,
1111
RedisTestEntityFields,
12-
} from '../testfixtures/RedisTestEntity';
13-
import { createRedisIntegrationTestEntityCompanionProvider } from '../testfixtures/createRedisIntegrationTestEntityCompanionProvider';
12+
} from '../__testfixtures__/RedisTestEntity';
13+
import { createRedisIntegrationTestEntityCompanionProvider } from '../__testfixtures__/createRedisIntegrationTestEntityCompanionProvider';
1414

1515
class TestViewerContext extends ViewerContext {}
1616

0 commit comments

Comments
 (0)