@awsless/awsless 0.0.554 → 0.0.556

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -2106,7 +2106,12 @@ var TasksSchema = z40.record(ResourceIdSchema, TaskSchema).optional().describe("
2106
2106
 
2107
2107
  // src/feature/test/schema.ts
2108
2108
  import { z as z41 } from "zod";
2109
- var TestsSchema = z41.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
2109
+ var TestsSchema = z41.union([
2110
+ //
2111
+ LocalDirectorySchema.transform((v) => [v]),
2112
+ LocalDirectorySchema.array(),
2113
+ z41.literal(false)
2114
+ ]).describe("Define the location of your tests for your stack.").optional();
2110
2115
 
2111
2116
  // src/config/stack.ts
2112
2117
  var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
@@ -5935,11 +5940,14 @@ var taskFeature = defineFeature({
5935
5940
  var testFeature = defineFeature({
5936
5941
  name: "test",
5937
5942
  onStack(ctx) {
5938
- if (ctx.stackConfig.tests) {
5943
+ if (Array.isArray(ctx.stackConfig.tests)) {
5939
5944
  ctx.registerTest(ctx.stackConfig.name, ctx.stackConfig.tests);
5940
- } else {
5945
+ } else if (typeof ctx.stackConfig.tests === "undefined") {
5941
5946
  ctx.addWarning({
5942
- message: `Stack ${color.info(ctx.stack.name)} has no tests defined. Consider adding test cases to ensure stability.`
5947
+ message: [
5948
+ `Stack ${color.info(ctx.stack.name)} has no tests defined.`,
5949
+ `Consider adding test cases to ensure stability.`
5950
+ ].join(" ")
5943
5951
  });
5944
5952
  }
5945
5953
  }
@@ -8409,13 +8417,12 @@ var CustomReporter = class {
8409
8417
  return [];
8410
8418
  }
8411
8419
  const item = test2.type === "suite" ? test2 : test2.file;
8412
- console.log(test2.result.errors);
8413
8420
  return test2.result.errors.map((error) => {
8414
8421
  const traces = error.stackStr ? parseStacktrace(error.stackStr) : [];
8415
8422
  return {
8416
8423
  location: {
8417
- line: traces[0]?.line,
8418
- column: traces[0]?.column
8424
+ line: traces[0]?.line ?? item.location?.line,
8425
+ column: traces[0]?.column ?? item.location?.column
8419
8426
  },
8420
8427
  file: item.name,
8421
8428
  test: test2.type === "test" ? test2.name : void 0,
@@ -8551,10 +8558,12 @@ var logTestLogs = (event) => {
8551
8558
  var formatFileName = (error) => {
8552
8559
  const name = [error.file];
8553
8560
  const loc = error.location;
8554
- if (typeof loc.line === "number") {
8555
- name.push(`:${loc.line}`);
8556
- if (typeof loc.column === "number") {
8557
- name.push(`:${loc.column}`);
8561
+ if (loc) {
8562
+ if (typeof loc.line === "number") {
8563
+ name.push(`:${loc.line}`);
8564
+ if (typeof loc.column === "number") {
8565
+ name.push(`:${loc.column}`);
8566
+ }
8558
8567
  }
8559
8568
  }
8560
8569
  return name.join("");
@@ -1498,7 +1498,12 @@ var TasksSchema = z37.record(ResourceIdSchema, TaskSchema).optional().describe("
1498
1498
 
1499
1499
  // src/feature/test/schema.ts
1500
1500
  import { z as z38 } from "zod";
1501
- var TestsSchema = z38.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
1501
+ var TestsSchema = z38.union([
1502
+ //
1503
+ LocalDirectorySchema.transform((v) => [v]),
1504
+ LocalDirectorySchema.array(),
1505
+ z38.literal(false)
1506
+ ]).describe("Define the location of your tests for your stack.").optional();
1502
1507
 
1503
1508
  // src/config/stack.ts
1504
1509
  var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
Binary file
Binary file
Binary file