Skip to content

Commit a0e5bcc

Browse files
authored
Merge pull request #1262 from jescalada/plugin-loader-test-fixes
fix: Plugin loader tests
2 parents 981d7b8 + 7a28c43 commit a0e5bcc

File tree

3 files changed

+26
-29
lines changed

3 files changed

+26
-29
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
"import": "./dist/src/types/models.js",
3030
"require": "./dist/src/types/models.js",
3131
"types": "./dist/src/types/models.d.ts"
32+
},
33+
"./plugin": {
34+
"import": "./dist/src/plugin.js",
35+
"require": "./dist/src/plugin.js",
36+
"types": "./dist/src/plugin.d.ts"
3237
}
3338
},
3439
"scripts": {

test/plugin/plugin.test.js

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,34 @@ describe('loading plugins from packages', function () {
2222
spawnSync('npm', ['install'], { cwd: testPackagePath, timeout: 5000 });
2323
});
2424

25-
it.skip(
26-
'should load plugins that are the default export (module.exports = pluginObj)',
27-
async function () {
28-
const loader = new PluginLoader([join(testPackagePath, 'default-export.js')]);
29-
await loader.load();
30-
expect(loader.pushPlugins.length).to.equal(1);
31-
expect(loader.pushPlugins.every((p) => isCompatiblePlugin(p))).to.be.true;
32-
expect(loader.pushPlugins[0]).to.be.an.instanceOf(PushActionPlugin);
33-
},
34-
).timeout(10000);
25+
it('should load plugins that are the default export (module.exports = pluginObj)', async function () {
26+
const loader = new PluginLoader([join(testPackagePath, 'default-export.js')]);
27+
await loader.load();
28+
expect(loader.pushPlugins.length).to.equal(1);
29+
expect(loader.pushPlugins.every((p) => isCompatiblePlugin(p))).to.be.true;
30+
expect(loader.pushPlugins.every((p) => isCompatiblePlugin(p, 'isGitProxyPushActionPlugin'))).to
31+
.be.true;
32+
}).timeout(10000);
3533

36-
it.skip(
37-
'should load multiple plugins from a module that match the plugin class (module.exports = { pluginFoo, pluginBar })',
38-
async function () {
39-
const loader = new PluginLoader([join(testPackagePath, 'multiple-export.js')]);
40-
await loader.load();
41-
expect(loader.pushPlugins.length).to.equal(1);
42-
expect(loader.pullPlugins.length).to.equal(1);
43-
expect(loader.pushPlugins.every((p) => isCompatiblePlugin(p))).to.be.true;
44-
expect(loader.pushPlugins.every((p) => isCompatiblePlugin(p, 'isGitProxyPushActionPlugin')))
45-
.to.be.true;
46-
expect(loader.pullPlugins.every((p) => isCompatiblePlugin(p, 'isGitProxyPullActionPlugin')))
47-
.to.be.true;
48-
expect(loader.pushPlugins[0]).to.be.instanceOf(PushActionPlugin);
49-
expect(loader.pullPlugins[0]).to.be.instanceOf(PullActionPlugin);
50-
},
51-
).timeout(10000);
34+
it('should load multiple plugins from a module that match the plugin class (module.exports = { pluginFoo, pluginBar })', async function () {
35+
const loader = new PluginLoader([join(testPackagePath, 'multiple-export.js')]);
36+
await loader.load();
37+
expect(loader.pushPlugins.length).to.equal(1);
38+
expect(loader.pullPlugins.length).to.equal(1);
39+
expect(loader.pushPlugins.every((p) => isCompatiblePlugin(p))).to.be.true;
40+
expect(loader.pushPlugins.every((p) => isCompatiblePlugin(p, 'isGitProxyPushActionPlugin'))).to
41+
.be.true;
42+
expect(loader.pullPlugins.every((p) => isCompatiblePlugin(p, 'isGitProxyPullActionPlugin'))).to
43+
.be.true;
44+
}).timeout(10000);
5245

53-
it.skip('should load plugins that are subclassed from plugin classes', async function () {
46+
it('should load plugins that are subclassed from plugin classes', async function () {
5447
const loader = new PluginLoader([join(testPackagePath, 'subclass.js')]);
5548
await loader.load();
5649
expect(loader.pushPlugins.length).to.equal(1);
5750
expect(loader.pushPlugins.every((p) => isCompatiblePlugin(p))).to.be.true;
5851
expect(loader.pushPlugins.every((p) => isCompatiblePlugin(p, 'isGitProxyPushActionPlugin'))).to
5952
.be.true;
60-
expect(loader.pushPlugins[0]).to.be.instanceOf(PushActionPlugin);
6153
}).timeout(10000);
6254

6355
it('should not load plugins that are not valid modules', async function () {

0 commit comments

Comments
 (0)