From 063b099121e726e37dfd56e7e70d7e8dea427f49 Mon Sep 17 00:00:00 2001 From: Haoliang Yu Date: Mon, 19 Oct 2020 15:06:15 -0400 Subject: [PATCH] add one more test --- test/index.test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/index.test.js b/test/index.test.js index dd5dd48..70e29c3 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -106,4 +106,29 @@ describe('Node.js APIs', () => { } }) }) + + describe('validate()', () => { + let pluginName, pluginPath + + beforeEach(async () => { + pluginName = `validate-api-test-${Date.now()}` + pluginPath = path.join(temp, pluginName) + + await createNewProject(temp, 'provider', pluginName, { + skipGit: true, + skipInstall: true, + quiet: true + }) + }) + + it('should work', async () => { + try { + const result = await api.validate(pluginPath) + expect(result.valid).to.equal(true) + expect(result.errors).to.equal(undefined) + } catch (e) { + expect.fail(e.message) + } + }) + }) })