Skip to content

Commit

Permalink
Downstream mattermost-plugin-starter-template (matterpoll#381)
Browse files Browse the repository at this point in the history
* build: add plan.yml for sync

* build: make sync

* lint: disable fieldalignment

* fix: transpilation warnings

* fix: lint error

* revert changes

* remove header comments

Co-authored-by: Ben Schumacher <[email protected]>
  • Loading branch information
kaakaa and hanzei authored Oct 2, 2021
1 parent 864ac37 commit e43aed8
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ trim_trailing_whitespace = true
[*.go]
indent_style = tab

[*.{js,jsx,ts,tsx,json,html}]
[*.{js, jsx, ts, tsx, json, html}]
indent_style = space
indent_size = 4

[webapp/package.json]
indent_size = 2

[Makefile,*.mk]
[{Makefile, *.mk}]
indent_style = tab

[*.md]
Expand Down
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ linters-settings:
govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment
misspell:
locale: US
maligned:
suggest-new: true

linters:
disable-all: true
enable:
Expand Down
44 changes: 44 additions & 0 deletions build/synk/plan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
checks:
- type: repo_is_clean
params:
repo: source
- type: repo_is_clean
params:
repo: target
actions:
- paths:
- build/pluginctl
- build/manifest
actions:
- type: overwrite_directory
params:
create: true
- paths:
- Makefile
actions:
- type: overwrite_file
params:
create: true
- paths:
- .editorconfig
- .gitattributes
- .gitignore
- build/.gitignore
- build/go.mod
- build/go.sum
- build/setup.mk
- server/.gitignore
#- webapp/.eslintrc.json
- webapp/.npmrc
- webapp/babel.config.js
#- webapp/package.json
- webapp/tsconfig.json
- webapp/webpack.config.js
- webapp/src/manifest.test.ts
- webapp/tests/setup.js
actions:
- type: overwrite_file
params:
create: true
conditions:
- type: file_unaltered
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"jest-canvas-mock"
],
"setupFilesAfterEnv": [
"<rootDir>/tests/setup.js"
"<rootDir>/tests/setup.tsx"
],
"testURL": "http://localhost:8065"
}
Expand Down
13 changes: 13 additions & 0 deletions webapp/src/manifest.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import manifest, {id, version} from './manifest';

test('Plugin manifest, id and version are defined', () => {
expect(manifest).toBeDefined();
expect(manifest.id).toBeDefined();
expect(manifest.version).toBeDefined();
});

// To ease migration, verify separate export of id and version.
test('Plugin id and version are defined', () => {
expect(id).toBeDefined();
expect(version).toBeDefined();
});
8 changes: 4 additions & 4 deletions webapp/tests/setup.js → webapp/tests/setup.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'mattermost-webapp/tests/setup';
import '@babel/polyfill';
import Adapter from 'enzyme-adapter-react-16';
import {configure} from 'enzyme';

configure({adapter: new Adapter()});
import {jest} from '@jest/globals';

// @ts-ignore
global.ReactBootstrap = require('react-bootstrap');

// @ts-ignore
global.PostUtils = {
formatText: jest.fn().mockImplementation((t) => 'mockFormatText(' + t + ')'),
messageHtmlToComponent: jest.fn().mockImplementation((t) => 'mockMessageHtmlToComponent(' + t + ')'),
Expand Down

0 comments on commit e43aed8

Please sign in to comment.