Skip to content

Commit bf57a27

Browse files
committed
test: add fixtures for esm plugin tests
1 parent a0e5bcc commit bf57a27

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { PushActionPlugin } from '@finos/git-proxy/plugin';
2+
3+
// test default export (ESM syntax)
4+
export default new PushActionPlugin(async (req, action) => {
5+
console.log('Dummy plugin: ', action);
6+
return action;
7+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { PushActionPlugin, PullActionPlugin } from '@finos/git-proxy/plugin';
2+
3+
// test multiple exports (ESM syntax)
4+
export default {
5+
foo: new PushActionPlugin(async (req, action) => {
6+
console.log('PushActionPlugin: ', action);
7+
return action;
8+
}),
9+
bar: new PullActionPlugin(async (req, action) => {
10+
console.log('PullActionPlugin: ', action);
11+
return action;
12+
}),
13+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { PushActionPlugin } from '@finos/git-proxy/plugin';
2+
3+
class DummyPlugin extends PushActionPlugin {
4+
constructor(exec) {
5+
super();
6+
this.exec = exec;
7+
}
8+
}
9+
10+
// test default export (ESM syntax)
11+
export default new DummyPlugin(async (req, action) => {
12+
console.log('Dummy plugin: ', action);
13+
return action;
14+
});

0 commit comments

Comments
 (0)