mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
Merge branch 'thomasleveil-patch-2'
This commit is contained in:
commit
f8db495e0f
|
@ -54,13 +54,12 @@ Windows:
|
|||
npm install -g windows-build-tools
|
||||
```
|
||||
|
||||
|
||||
#### lerna
|
||||
|
||||
n8n is split up in different modules which are all in a single mono repository.
|
||||
To facilitate those modules management, [lerna](https://lerna.js.org) gets
|
||||
used. It automatically sets up file-links between modules which depend on each
|
||||
others.
|
||||
other.
|
||||
|
||||
So for the setup to work correctly lerna has to be installed globally like this:
|
||||
|
||||
|
@ -79,17 +78,17 @@ checked out and set up:
|
|||
git clone https://github.com/n8n-io/n8n.git
|
||||
```
|
||||
|
||||
2. Go into repository folder
|
||||
1. Go into repository folder
|
||||
```
|
||||
cd n8n
|
||||
```
|
||||
|
||||
3. Install all dependencies of all modules and link them together:
|
||||
1. Install all dependencies of all modules and link them together:
|
||||
```
|
||||
lerna bootstrap --hoist
|
||||
```
|
||||
|
||||
4. Build all the code:
|
||||
1. Build all the code:
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
@ -103,3 +102,39 @@ To start n8n execute:
|
|||
```
|
||||
npm run start
|
||||
```
|
||||
|
||||
|
||||
## Development Cycle
|
||||
|
||||
While iterating on n8n modules code, you can run `npm run dev`. It will then
|
||||
automatically build your code, restart the backend and refresh the frontend
|
||||
(editor-ui) on every change you make.
|
||||
|
||||
1. Start n8n in development mode:
|
||||
```
|
||||
npm run dev
|
||||
```
|
||||
1. hack, hack, hack
|
||||
1. Check if everything still runs in production mode
|
||||
```
|
||||
npm run build
|
||||
npm run start
|
||||
```
|
||||
1. Create tests
|
||||
1. Run all tests
|
||||
```
|
||||
npm run test
|
||||
```
|
||||
1. Commit code and create pull request
|
||||
|
||||
|
||||
### Test suite
|
||||
|
||||
The tests can be started via:
|
||||
```
|
||||
npm run test
|
||||
```
|
||||
|
||||
If that gets executed in one of the package folders it will only run the tests
|
||||
of this package. If it gets executed in the n8n-root folder it will run all
|
||||
tests of all packages.
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
"build": "lerna exec npm run build",
|
||||
"dev": "lerna exec npm run dev --parallel",
|
||||
"start": "cd packages/cli && node dist/index.js start",
|
||||
"test": "lerna run test",
|
||||
"watch": "lerna run --parallel watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
7
packages/cli/test/placeholder.test.ts
Normal file
7
packages/cli/test/placeholder.test.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
describe('Placeholder', () => {
|
||||
|
||||
test('example', () => {
|
||||
expect(1 + 1).toEqual(2);
|
||||
});
|
||||
|
||||
});
|
|
@ -16,6 +16,7 @@
|
|||
"dev": "npm run serve",
|
||||
"lint": "vue-cli-service lint",
|
||||
"serve": "VUE_APP_URL_BASE_API=http://localhost:5678/ vue-cli-service serve",
|
||||
"test": "npm run test:unit",
|
||||
"tslint": "tslint -p tsconfig.json -c tslint.json",
|
||||
"test:e2e": "vue-cli-service test:e2e",
|
||||
"test:unit": "vue-cli-service test:unit"
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
// import { shallowMount } from '@vue/test-utils';
|
||||
// import HelloWorld from '@/components/HelloWorld.vue';
|
||||
|
||||
// describe('HelloWorld.vue', () => {
|
||||
// it('renders props.msg when passed', () => {
|
||||
// const msg = 'new message';
|
||||
// const wrapper = shallowMount(HelloWorld, {
|
||||
// propsData: { msg }
|
||||
// });
|
||||
// expect(wrapper.text()).toMatch(msg);
|
||||
// });
|
||||
// });
|
5
packages/editor-ui/tests/unit/placeholder.spec.ts
Normal file
5
packages/editor-ui/tests/unit/placeholder.spec.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
describe('Placeholder.vue', () => {
|
||||
it('example', () => {
|
||||
expect(1 + 1).toEqual(2);
|
||||
});
|
||||
});
|
|
@ -16,6 +16,7 @@
|
|||
"scripts": {
|
||||
"dev": "npm run watch",
|
||||
"build": "tsc",
|
||||
"test": "jest",
|
||||
"tslint": "tslint -p tsconfig.json -c tslint.json",
|
||||
"watch": "tsc --watch"
|
||||
},
|
||||
|
@ -45,5 +46,23 @@
|
|||
"replace-in-file": "^4.1.0",
|
||||
"typescript": "~3.5.2",
|
||||
"vorpal": "^1.12.0"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
},
|
||||
"testURL": "http://localhost/",
|
||||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||
"testPathIgnorePatterns": [
|
||||
"/dist/",
|
||||
"/node_modules/"
|
||||
],
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"json",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
7
packages/node-dev/test/placeholder.test.ts
Normal file
7
packages/node-dev/test/placeholder.test.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
describe('Placeholder', () => {
|
||||
|
||||
test('example', () => {
|
||||
expect(1 + 1).toEqual(2);
|
||||
});
|
||||
|
||||
});
|
|
@ -4,7 +4,8 @@
|
|||
"es2017"
|
||||
],
|
||||
"types": [
|
||||
"node"
|
||||
"node",
|
||||
"jest"
|
||||
],
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
|
@ -26,6 +27,7 @@
|
|||
],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"node_modules/**/*",
|
||||
"**/*.spec.ts"
|
||||
]
|
||||
}
|
||||
|
|
7
packages/nodes-base/test/placeholder.test.ts
Normal file
7
packages/nodes-base/test/placeholder.test.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
describe('Placeholder', () => {
|
||||
|
||||
test('example', () => {
|
||||
expect(1 + 1).toEqual(2);
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in a new issue