diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index aee5e8ff..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,57 +0,0 @@ -version: 2.1 -description: Fauna Shell Tests - -executors: - core: - resource_class: large - docker: - - image: cimg/node:18.20 - - - image: fauna/faunadb - name: core - - environment: - FAUNA_SECRET: secret - FAUNA_DOMAIN: core - FAUNA_SCHEME: http - FAUNA_PORT: 8443 - -commands: - build_and_test: - description: "Run fauna-shell tests" - steps: - - checkout - - - setup_remote_docker: - version: 24.0 - docker_layer_caching: true - - - run: - name: Install dependencies - command: yarn install - - - run: - name: Wait FaunaDB init - command: | - while ! $(curl --output /dev/null --silent --fail --max-time 1 http://core:8443/ping); do sleep 1; done - - - run: - name: Run Tests - command: yarn test - - - store_artifacts: - path: coverage - -jobs: - fauna-shell-tests: - executor: - name: core - steps: - - build_and_test - -workflows: - version: 2 - build_and_test: - jobs: - - fauna-shell-tests: - context: faunadb-drivers diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..798759a7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI +on: [push] + +jobs: + build: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: Install + uses: borales/actions-yarn@v4 + with: + cmd: install + + - name: Tests + uses: borales/actions-yarn@v4 + env: + FAUNA_SECRET: ${{ secrets.FAUNA_SECRET }} + FAUNA_DOMAIN: ${{ secrets.FAUNA_DOMAIN }} + FAUNA_SCHEME: ${{ secrets.FAUNA_SCHEME }} + FAUNA_PORT: ${{ secrets.FAUNA_PORT }} + with: + cmd: test diff --git a/package.json b/package.json index f7e87505..93758b31 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "prepack": "yarn build && oclif manifest", "pretest": "yarn fixlint", "local-test": "export $(cat .env | xargs); mocha \"test/**/*.test.{js,ts}\"", - "test": "export $(cat .env.test | xargs); c8 -r html mocha --forbid-only \"test/**/*.test.{js,ts}\"", + "test": "c8 -r html mocha --forbid-only \"test/**/*.test.{js,ts}\"", "lint": "eslint .", "fixlint": "eslint . --fix", "version": "oclif-dev readme && git add README.md", diff --git a/test/commands/eval.test.js b/test/commands/eval.test.js index 7a2e953e..5355019c 100644 --- a/test/commands/eval.test.js +++ b/test/commands/eval.test.js @@ -97,11 +97,13 @@ describe("eval", () => { }); describe("eval in v10", () => { - it("runs eval", async () => { + it("runs eval in shell format", async () => { const { stdout } = await runCommand( withOpts([ "eval", "\"{ exists: Collection.byName('doesnt_exist').exists() }\"", + "--format", + "shell", ]) ); expect(stdout).to.equal("{\n exists: false\n}\n"); @@ -182,7 +184,7 @@ function mockQuery(api) { .post("/", matchFqlReq(q.Now())) .reply(200, { resource: new Date() }) .post("/", matchFqlReq(q.Paginate(q.Collections()))) - .reply(200, function () { + .reply(200, function() { const auth = this.req.headers.authorization.split(" ")[1].split(":"); expect(this.req.headers["x-fauna-shell-builtin"]).to.not.exist; return {