Skip to content

Commit

Permalink
add one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
haoliangyu committed Oct 19, 2020
1 parent cb404bc commit 063b099
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
})
})

0 comments on commit 063b099

Please sign in to comment.