Skip to content

handle text/plain content type in get.js, added additional tests for … #12

handle text/plain content type in get.js, added additional tests for …

handle text/plain content type in get.js, added additional tests for … #12

Workflow file for this run

# .github/workflows/ci.yml
# Continuous Integration (CI) Workflow
name: ci
# This workflow will run whenever we push commits to the `main` branch, or
# whenever there's a pull request to the `main` branch. See:
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#on
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
lint:
# Give your job a name that will show up in the GitHub Actions web UI
name: ESLint
# We'll run this on a Linux (Ubuntu) VM, since we'll deploy on Linux too.
runs-on: ubuntu-latest
# We run these steps one after the other, and if any fail, we stop the process
steps:
# https://github.com/actions/checkout
- name: Check out code
uses: actions/checkout@v4
# https://github.com/actions/setup-node
- name: Setup node
uses: actions/setup-node@v4
with:
# Use node LTS https://github.com/actions/setup-node#supported-version-syntax
node-version: 'lts/*'
# Cache npm dependencies so they don't have to be downloaded next time - https://github.com/actions/setup-node#caching-packages-dependencies
cache: 'npm'
- name: Install node dependencies
# Use `ci` vs. `install`, see https://docs.npmjs.com/cli/v8/commands/npm-ci
run: npm ci
- name: Run ESLint
run: npm run lint
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install node dependencies and run Tests
# There are two ways we could do this:
#
# 1. Call `npm ci` followed by `npm test` like so (NOTE: the use of | and -):
# run: |
# - npm install
# - npm test
#
# 2. Use `install-ci-test` to do it in a single command, see https://docs.npmjs.com/cli/v8/commands/npm-install-ci-test
# run: npm install-ci-test
run: npm install-ci-test