Skip to content

Commit

Permalink
chore: migrate tests to typescript, add monorepo e2e test, added unit…
Browse files Browse the repository at this point in the history
… test

fix: don't absorb all jest-dynalite-config errors
  • Loading branch information
freshollie committed Nov 26, 2020
1 parent eae75c6 commit 1a43ccd
Show file tree
Hide file tree
Showing 61 changed files with 5,043 additions and 172 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Pipeline

on: [push, pull_request]
on: [push]

jobs:
lint:
Expand All @@ -14,10 +14,11 @@ jobs:
node-version: "10.x"
- name: Lint
run: |
yarn --frozen-lockfile
yarn --frozen-lockfile --ignore-scripts
yarn lint
env:
CI: true

build:
runs-on: ubuntu-latest

Expand All @@ -30,7 +31,7 @@ jobs:
- name: Build
run: |
yarn --frozen-lockfile --ignore-scripts
yarn build
yarn test:types
env:
CI: true

Expand All @@ -51,11 +52,15 @@ jobs:
- name: Test
run: |
yarn --frozen-lockfile --ignore-scripts
yarn test
yarn test --coverage
env:
CI: true
- name: Publish Coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

test-example:
e2e:
runs-on: ubuntu-latest
needs: build

Expand All @@ -69,19 +74,17 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Test example
- name: E2E Tests
run: |
yarn
cd example
yarn
yarn test
yarn e2e
env:
CI: true

publish:
runs-on: ubuntu-latest

needs: [test, test-example]
needs: [lint, test, e2e]

if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '.')
steps:
Expand Down
11 changes: 0 additions & 11 deletions .jest/features/jest-advanced.config.js

This file was deleted.

11 changes: 0 additions & 11 deletions .jest/features/jest-environment.config.js

This file was deleted.

10 changes: 0 additions & 10 deletions .jest/features/jest-simple.config.js

This file was deleted.

11 changes: 0 additions & 11 deletions .jest/features/jest-tables-function-async.config.js

This file was deleted.

11 changes: 0 additions & 11 deletions .jest/features/jest-tables-function.config.js

This file was deleted.

5 changes: 0 additions & 5 deletions .jest/setupAdvanced.js

This file was deleted.

2 changes: 0 additions & 2 deletions .jest/setupSimple.js

This file was deleted.

5 changes: 0 additions & 5 deletions .jest/setupTablesFunction.js

This file was deleted.

5 changes: 0 additions & 5 deletions .jest/setupTablesFunctionAsync.js

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# jest-dynalite

[![Pipeline status](https://github.com/freshollie/jest-dynalite/workflows/Pipeline/badge.svg)](https://github.com/freshollie/jest-dynalite/actions)
[![Coverage Status](https://coveralls.io/repos/github/freshollie/jest-dynalite/badge.svg?branch=master)](https://coveralls.io/github/freshollie/jest-dynalite?branch=master)
[![Npm version](https://img.shields.io/npm/v/jest-dynalite)](https://www.npmjs.com/package/jest-dynalite)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Expand Down Expand Up @@ -239,10 +240,15 @@ yarn test

### Tests

Tests are designed as a mix of unit and integration tests.
Tests are designed as a mix of unit, integration tests, and e2e tests.

Each run of the project is configured by `.jest/features` for each different
type of configuration for `jest-dynalite`
`yarn test` will run all unit and integration tests

Integration tests are configured under the `tests` directory, with
[jest projects](https://jestjs.io/docs/en/configuration#projects-arraystring--projectconfig) used to managed
testing different configurations for jest-dynalite.

`yarn e2e` will run e2e tests

## License

Expand Down
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
],
};
3 changes: 3 additions & 0 deletions e2e/monorepo/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
projects: ["<rootDir>/packages/*/jest.config.js"],
};
11 changes: 11 additions & 0 deletions e2e/monorepo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "jest-dynalite-e2e-monorepo",
"private": true,
"workspaces": ["./packages/*"],
"scripts": {
"test": "jest"
},
"devDependencies": {
"jest": "^26.5.2"
}
}
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions e2e/monorepo/packages/keystore/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "monorepo-package",
"version": "1.0.0",
"private": true,
"scripts": {
"test": "jest"
},
"devDependencies": {
"jest-dynalite": "file:../../../../"
},
"dependencies": {
"aws-sdk": "^2.771.0"
}
}
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 1a43ccd

Please sign in to comment.