diff --git a/test/docker.bats b/test/docker.bats index 7366351771bfbae675fb5232ec586c04495e9fa2..3b580a42bf6d6fc5fb421cd2dcd5d02a3d8b8783 100644 --- a/test/docker.bats +++ b/test/docker.bats @@ -5,51 +5,53 @@ function dockerRun() { docker run -v "$(pwd)":/bot ${IMAGE_NAME:-'wechaty:test'} $@ } +fixture=test/fixture/docker + @test "javascript bot" { - cd docker-bot + cd "$fixture" run dockerRun js-bot.js [ "$status" -eq 0 ] } @test "javascript syntax error" { - cd docker-bot + cd "$fixture" run dockerRun syntax-error.js [ "$status" -ne 0 ] } @test "typescript bot" { - cd docker-bot + cd "$fixture" run dockerRun ts-bot.ts [ "$status" -eq 0 ] } @test "typescript type error" { - cd docker-bot + cd "$fixture" run dockerRun type-error.ts [ "$status" -ne 0 ] } @test "javascript bot with require" { - cd docker-bot/with-package-json/ + cd "$fixture/with-package-json/" run dockerRun with-require.js [ "$status" -eq 0 ] } @test "javascript bot require error" { - cd docker-bot/with-package-json/ + cd "$fixture/with-package-json/" run dockerRun with-require-error.js [ "$status" -ne 0 ] } @test "typescript bot with import" { - cd docker-bot/with-package-json/ + cd "$fixture/with-package-json/" run dockerRun with-import.ts [ "$status" -eq 0 ] } @test "typescript bot with import error" { - cd docker-bot/with-package-json/ + cd "$fixture/with-package-json/" run dockerRun with-import-error.ts [ "$status" -ne 0 ] } diff --git a/test/docker-bot/js-bot.js b/test/fixture/docker/js-bot.js similarity index 100% rename from test/docker-bot/js-bot.js rename to test/fixture/docker/js-bot.js diff --git a/test/docker-bot/syntax-error.js b/test/fixture/docker/syntax-error.js similarity index 100% rename from test/docker-bot/syntax-error.js rename to test/fixture/docker/syntax-error.js diff --git a/test/docker-bot/ts-bot.ts b/test/fixture/docker/ts-bot.ts similarity index 100% rename from test/docker-bot/ts-bot.ts rename to test/fixture/docker/ts-bot.ts diff --git a/test/docker-bot/type-error.ts b/test/fixture/docker/type-error.ts similarity index 100% rename from test/docker-bot/type-error.ts rename to test/fixture/docker/type-error.ts diff --git a/test/docker-bot/with-package-json/package.json b/test/fixture/docker/with-package-json/package.json similarity index 100% rename from test/docker-bot/with-package-json/package.json rename to test/fixture/docker/with-package-json/package.json diff --git a/test/docker-bot/with-package-json/with-import-error.ts b/test/fixture/docker/with-package-json/with-import-error.ts similarity index 100% rename from test/docker-bot/with-package-json/with-import-error.ts rename to test/fixture/docker/with-package-json/with-import-error.ts diff --git a/test/docker-bot/with-package-json/with-import.ts b/test/fixture/docker/with-package-json/with-import.ts similarity index 100% rename from test/docker-bot/with-package-json/with-import.ts rename to test/fixture/docker/with-package-json/with-import.ts diff --git a/test/docker-bot/with-package-json/with-require-error.js b/test/fixture/docker/with-package-json/with-require-error.js similarity index 100% rename from test/docker-bot/with-package-json/with-require-error.js rename to test/fixture/docker/with-package-json/with-require-error.js diff --git a/test/docker-bot/with-package-json/with-require.js b/test/fixture/docker/with-package-json/with-require.js similarity index 100% rename from test/docker-bot/with-package-json/with-require.js rename to test/fixture/docker/with-package-json/with-require.js