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

Handle system state messages #149

Merged
merged 21 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
6 changes: 4 additions & 2 deletions udmif/event-handler/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ globalConfig.json
.DS_Store

# environment variables
.env
setupEnv.sh

# mongo output
.mongodb
.mongodb

dist/
5 changes: 5 additions & 0 deletions udmif/event-handler/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

cd udmif/event-handler
npx lint-staged
2 changes: 1 addition & 1 deletion udmif/event-handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ npm run watch
1. Send an event to the local server using curl

```
curl -d "@devicePointSetStatesEvent.json" \
curl -d "@sample.json" \
-X POST \
-H "Ce-Type: true" \
-H "Ce-Specversion: true" \
Expand Down
3 changes: 3 additions & 0 deletions udmif/event-handler/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export MONGO_PROTOCOL=mongodb
export MONGO_HOST=localhost
export MONGO_DATABASE=device
52 changes: 0 additions & 52 deletions udmif/event-handler/index.js

This file was deleted.

10 changes: 10 additions & 0 deletions udmif/event-handler/jest-mongodb-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
mongodbMemoryServerOptions: {
binary: {
version: '4.0.3',
skipMD5: true,
},
autoStart: false,
instance: {},
},
};
21 changes: 21 additions & 0 deletions udmif/event-handler/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
roots: ['<rootDir>/src'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
reporters: [
"default",
],
collectCoverage: true,
coveragePathIgnorePatterns: ["/node_modules/", "/src/__tests__/"],
coverageReporters: [
"text",
"cobertura",
"lcov"
],
preset: "@shelf/jest-mongodb",
// testEnvironment: "node",
testRegex: '(/__tests__/spec.ts|(\\.|/)(test|spec))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
watchPathIgnorePatterns: ['globalConfig'],
}
Loading