Skip to content

Commit

Permalink
fix meta-needs
Browse files Browse the repository at this point in the history
  • Loading branch information
jupegarnica committed Oct 30, 2022
1 parent 63add6f commit 9c92b89
Show file tree
Hide file tree
Showing 10 changed files with 225 additions and 132 deletions.
38 changes: 38 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
// Use IntelliSense para saber los atributos posibles.
// Mantenga el puntero para ver las descripciones de los existentes atributos.
// Para más información, visite: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "Run Program",
"type": "node",
"program": "${workspaceFolder}/src/cli.ts",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "/home/juan/.deno/bin/deno",
"runtimeArgs": [
"run",
"--unstable",
"--inspect",
"--allow-all"
],
"attachSimplePort": 9229
},
{
"request": "launch",
"name": "Test Program",
"type": "node",
"program": "${workspaceFolder}/src/cli.ts",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "/home/juan/.deno/bin/deno",
"runtimeArgs": [
"test",
"--unstable",
"--inspect",
"--allow-all"
],
"attachSimplePort": 9229
}
]
}
1 change: 1 addition & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"tasks": {
"dev": "TEPI_NOT_EXIT=1 deno run -A --unstable --watch ./src/cli.ts",
"debug": "TEPI_NOT_EXIT=1 deno run --inspect-brk -A --unstable ./src/cli.ts ",
// test
"test": "NO_LOG=1 deno test -A --unstable",
"test-watch": "FORCE_COLOR=1 deno test -A --unstable --watch test",
Expand Down
2 changes: 1 addition & 1 deletion http/needs.http
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ x-quiet: true
id: block5
needs: block_1
---
GET /pong?status=204
GET /pong?status=205
x-quiet: true
3 changes: 2 additions & 1 deletion http/needs.loop.http
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ x-quiet: true
---
id: block_2
needs: block_1

---
POST /pong
x-quiet: true
x-body-block1: <%= block_1.body || 'not found' %>

<%= block_1.meta.id + '??' %>

Expand All @@ -29,7 +31,6 @@ x-quiet: true
---
id: block_3
needs: block_1
# TODO DEBUG
---
POST /pong
x-quiet: true
Expand Down
4 changes: 2 additions & 2 deletions http/only.http
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ host: <%= Deno.env.get("HOST") || "https://faker.deno.dev "%>
---
###
---
id: 204 No Content
id: no ignored
---
GET /pong?status=204
quiet: true
Expand All @@ -12,7 +12,7 @@ HTTP/1.1 204 No Content

###
---
id: 203 Non-Authoritative Information
id: ignored
only: <%= !!Deno.env.get('TEST_ONLY') %>
---

Expand Down
8 changes: 4 additions & 4 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async function cli() {

// resolves globs to file paths
/////////////
const globs: string = args._.length ? args._.join(" ") : "**/*.http";
const globs: string = args._.length ? args._.join(" ") : 'http/need.loop.http'//"**/*.http";
const filePathsToRun = await globsToFilePaths(globs.split(" "));

// runner
Expand All @@ -122,18 +122,18 @@ async function cli() {

// warn only mode
/////////////
if (onlyMode.length) {
if (onlyMode.size) {
if (getDisplayIndex(defaultMeta) > 0) {
console.warn(
fmt.yellow(
`\n${fmt.bgYellow(fmt.bold(" ONLY MODE "))
} ${onlyMode.length} tests are in "only" mode.`,
} ${onlyMode.size} tests are in "only" mode.`,
),
);
if (!exitCode) {
console.error(
fmt.red(
`Failed because the ${fmt.bold('"only"')} option was used at ${onlyMode.join(", ")
`Failed because the ${fmt.bold('"only"')} option was used at ${[...onlyMode].join(", ")
}`,
),
);
Expand Down
3 changes: 2 additions & 1 deletion src/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ function metaToText(meta: Meta): string {
return output;
}

export function printErrorsSummary(blocks: Block[]): void {
export function printErrorsSummary(_blocks: Set<Block>): void {
const blocks = Array.from(_blocks);
const blocksWidthErrors = blocks.filter((b) => b.error);

if (blocksWidthErrors.length) {
Expand Down
Loading

0 comments on commit 9c92b89

Please sign in to comment.