From e0f40926bbfb2bd2c904dbb76c08fbd8364a55e1 Mon Sep 17 00:00:00 2001 From: Amanda Bullington Date: Thu, 4 Nov 2021 17:00:16 -0700 Subject: [PATCH] Add Github Actions config file for unit tests --- .github/workflows/test.yml | 29 +++++++++++++++++++ .../Observations/__tests__/ObsList.test.js | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..a13689bfa --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +## +# Run unit test and the action itself +## +name: Unit Test +on: + pull_request: + push: + branches: + - main + - feature/** + +jobs: + # unit tests + unit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm ci + - run: npm test + + # test action works running from the graph + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm ci + - uses: ./ + with: + milliseconds: 1000 \ No newline at end of file diff --git a/components/Observations/__tests__/ObsList.test.js b/components/Observations/__tests__/ObsList.test.js index c76e16f2b..3b6c7a00d 100644 --- a/components/Observations/__tests__/ObsList.test.js +++ b/components/Observations/__tests__/ObsList.test.js @@ -1,5 +1,5 @@ import React from "react"; -import { render } from "@testing-library/react-native"; +// import { render } from "@testing-library/react-native"; import { NavigationContainer } from "@react-navigation/native"; import inatjs from "inaturalistjs"; import AccessibilityEngine from "react-native-accessibility-engine";