Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add basic pull, diff and push tests #43

Merged
merged 47 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a18748e
feat: add directus instance starter
EdouardDem Mar 30, 2024
86678b0
feat: working test bed with sample tests
EdouardDem Mar 30, 2024
dc10a90
feat: add directus sync client
EdouardDem Mar 30, 2024
18e5c04
chore: run format and lint
EdouardDem Mar 30, 2024
63690c1
chore: run format and lint
EdouardDem Mar 30, 2024
223fcb1
test: empty pull
EdouardDem Mar 30, 2024
a02a51b
test: empty pull
EdouardDem Mar 30, 2024
224ee90
test: test empty pull mutations
EdouardDem Apr 2, 2024
cbc0d01
chore: run prettier
EdouardDem Apr 2, 2024
60619ef
feat: add test for empty instance
EdouardDem Apr 3, 2024
ec6e1f2
feat: add first pull test with data
EdouardDem Apr 3, 2024
2266dd9
feat: test pull of collections
EdouardDem Apr 4, 2024
024e117
feat: test pull of collections
EdouardDem Apr 4, 2024
43026b3
fix: file import
EdouardDem Apr 4, 2024
2debda2
refactor: rename test basic
EdouardDem Apr 4, 2024
8d3f7b8
refactor: rename test basic
EdouardDem Apr 4, 2024
0ee4d50
test: add 'Pull 2 times from an instance' tests
EdouardDem Apr 5, 2024
d7dff33
refactor: create utils folder
EdouardDem Apr 5, 2024
dd3a250
refactor: rename directus client test
EdouardDem Apr 5, 2024
18c0dbd
test: add pull and push without changes
EdouardDem Apr 5, 2024
8f6d991
refactor: rename empty.spec.ts
EdouardDem Apr 5, 2024
5d3d5d3
test: add "preserve ids" and "pull flush and push"
EdouardDem Apr 5, 2024
1710fea
test: fix some random failing tests
EdouardDem Apr 5, 2024
e57557e
fix: revert package-lock.json
EdouardDem Apr 5, 2024
e7d6f97
fix: remove unsupported node version from CI
EdouardDem Apr 5, 2024
c12e0ba
fix: copy env file before tests
EdouardDem Apr 5, 2024
65a42d3
test: trigger cli programmatically
EdouardDem Apr 13, 2024
3c5e4e3
test: remove unstable helpers test
EdouardDem Apr 14, 2024
733deab
chore: add comment about debugging
EdouardDem Apr 14, 2024
8bdeabb
fix: eslint config
EdouardDem Apr 14, 2024
99ae0b3
ci: build before tests
EdouardDem Apr 14, 2024
42e377d
ci: increase jest timeout for ci
EdouardDem Apr 14, 2024
74f71a1
ci: limit number of workers
EdouardDem Apr 14, 2024
c9bca4f
test: migration from a server to another
EdouardDem Apr 14, 2024
f9ad483
fix: dependency issue on darwin-arm64
EdouardDem Apr 15, 2024
ba008a0
fix: move dependency to dev
EdouardDem Apr 15, 2024
8f7f7dc
fix: remove @nx/nx-darwin-arm64
EdouardDem Apr 18, 2024
be40ff4
feat: use jasmine and run sequentially (#49)
EdouardDem Apr 22, 2024
aecedb4
build(e2e): fix ci
EdouardDem Apr 22, 2024
cc648ad
build(e2e): fix ci
EdouardDem Apr 22, 2024
eab7dd1
chore: run prettier
EdouardDem Apr 22, 2024
ac0744e
fix: x64 dependencies
EdouardDem Apr 22, 2024
fe66468
fix: x64 dependencies
EdouardDem Apr 22, 2024
f2bf685
fix: change ts config per test env
EdouardDem Apr 22, 2024
0bcc9e1
fix(e2e): append logs to file
EdouardDem Apr 23, 2024
67d34e2
feat(e2e): add pushOnEmptyInstance
EdouardDem Apr 23, 2024
f0f1505
feat(e2e): add pushOnEmptyInstance
EdouardDem Apr 23, 2024
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
4 changes: 3 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env node */
module.exports = {
ignorePatterns: ['dist/', 'node_modules/', '*.js', '*.cjs', '*.mjs'],
ignorePatterns: ['dist/', 'node_modules/', 'directus/', '*.js', '*.cjs', '*.mjs'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended-type-checked',
Expand All @@ -17,7 +17,9 @@ module.exports = {
root: true,
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -20,5 +20,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
- run: npm run test
# Build before testing. Tests needs the api package to be built
- run: npm run build
- run: npm run bootstrap
- run: npm run test
34,555 changes: 22,789 additions & 11,766 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"lerna": "lerna",
"clean": "lerna clean",
"build": "lerna run build",
"bootstrap": "lerna run bootstrap",
"test": "lerna run test",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,gql,mjs}\"",
"lint": "eslint --fix .",
Expand Down
8 changes: 8 additions & 0 deletions packages/api/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.spec.json',
},
],
},
};
1 change: 0 additions & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"http-errors": "^2.0.0",
"jest": "^29.7.0",
"pino": "^8.19.0",
"sqlite3": "^5.1.7",
"ts-jest": "^29.1.2",
"typescript": "^5.4.2",
"zod": "^3.22.4"
Expand Down
6 changes: 6 additions & 0 deletions packages/api/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"types": ["jest", "node"]
}
}
1 change: 1 addition & 0 deletions packages/cli/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ test/
.env
.gitignore
example.env
test.env
jest.config.js
tsconfig.json
directus-sync.config.*
3 changes: 2 additions & 1 deletion packages/cli/bin/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#! /usr/bin/env node
require('../dist');
const { run } = require('../dist');
void run();
3 changes: 2 additions & 1 deletion packages/cli/example.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DIRECTUS_URL=http://localhost:8055
DIRECTUS_TOKEN=xxxxxxxxxxxxx
DIRECTUS_ADMIN_EMAIL=admin@example.com
DIRECTUS_ADMIN_PASSWORD=password
8 changes: 8 additions & 0 deletions packages/cli/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.spec.json',
},
],
},
};
Loading
Loading