contest-framework / roadmap

Longer-term product management items that don't fit into particular client or server repositories.
0 stars 0 forks source link

more flexible wire protocol #8

Open kevgo opened 2 years ago

kevgo commented 2 years ago

Client sends things like this:

{}

or

{
  "file": "foo.js"
}

or

{
  "file": "foo.js",
  "line": "12"
}

or

{
  "run": "make unit"
}

The server performs pattern matching on the data structure sent. This means we don't need the command field when testing individual files.

Corresponding server config file:

{
  "actions": [
    {
      "when": {},
      "then": "make test",
    },
    {
      "when": { "file": "**/*_test.go" },
      "then": "go test {{file}}",
    },
    {
      "when": { "file": "**/*.test.ts", "line": "*" },
      "then": "mocha {{file}}:{{line}}",
    }
  ],
  "options": {}
}
kevgo commented 1 month ago

Even simpler wire protocol:

# sending a newline runs all tests

# test this file:
test/foo.ts

# test this file at this line:
bar.test.ts:55

# run this custom command:
`make unit`
run: make unit