Skip to main content
Sign in
Snippets Groups Projects
Commit aac966a8 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Accept string & object versions.

parent 787ebc71
No related branches found
No related tags found
1 merge request!2Add CI.
Pipeline #1376 failed
...@@ -304,13 +304,24 @@ async function main() { ...@@ -304,13 +304,24 @@ async function main() {
undefined, undefined,
`Package ${dependencyName} is missing from ${pyProjectTomlPath} dependencies.`, `Package ${dependencyName} is missing from ${pyProjectTomlPath} dependencies.`,
) )
assert.strictEqual( if (typeof dependency !== "string") {
typeof dependency, assert.notStrictEqual(
"string", (dependency as PyProjectDependencyObject).optional,
`In ${pyProjectTomlPath}, ${dependencyName} dependency should be a string and not an object. Got ${JSON.stringify( true,
`In ${pyProjectTomlPath}, ${dependencyName} dependency should be optional, got ${JSON.stringify(
dependency, dependency,
)}.`, )} instead.`,
) )
if (
(dependency as PyProjectDependencyObject).version === undefined
) {
assert.notStrictEqual(
(dependency as PyProjectDependencyObject).git,
undefined,
`In ${pyProjectTomlPath}, ${dependencyName} dependency is missing "git" or "version" attribute.`,
)
}
}
} }
// Test project with its current dependencies. // Test project with its current dependencies.
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment