Remove isExpression flag and implement convertToIfCondition to align with Go parser architecture (#217)
This commit is contained in:
@@ -194,10 +194,11 @@ jobs:
|
||||
const jobs = workflowRoot.get(1).value.assertMapping("jobs");
|
||||
const build = jobs.get(0).value.assertMapping("job");
|
||||
const ifToken = build.get(1).value;
|
||||
expect(ifToken.toString()).toEqual("${{ github.event_name == 'push' }}");
|
||||
// Without isExpression: true, the value is kept as a string until convertToIfCondition processes it
|
||||
expect(ifToken.toString()).toEqual("github.event_name == 'push'");
|
||||
|
||||
if (!isBasicExpression(ifToken)) {
|
||||
throw new Error("expected if to be a basic expression");
|
||||
if (!isString(ifToken)) {
|
||||
throw new Error("expected if to be a string (will be converted to expression later)");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user