Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test yaml template #27

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[ignore]
.*/dist/.*
.*/__tests__/.*
.*/node_modules/resolve/test/resolver/malformed_package_json/package.json
27 changes: 11 additions & 16 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on: # Rebuild any PRs and main branch changes
- main
pull_request:

step-node: &setup-node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn



jobs:

Expand All @@ -15,10 +22,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- <<: *setup-node
- name: Validate cache
run: yarn install --frozen-lockfile

Expand All @@ -29,10 +33,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- <<: *setup-node
- name: install
run: yarn install --frozen-lockfile
- name: test
Expand All @@ -45,10 +46,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- <<: *setup-node
- name: install
run: yarn install --frozen-lockfile
- name: lint
Expand All @@ -63,10 +61,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- <<: *setup-node
- name: install
run: yarn install --frozen-lockfile
- name: format-check
Expand Down
15 changes: 15 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"default": true,
"MD013": {
"line_length": 10000,
"headings": false,
"code_blocks": false,
"tables": false
},
"MD024": {
"siblings_only": true
},
"MD041": false,
"MD033": false,
"MD001": false
}
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Data snapshots should be committed to version control, as regular snapshot files

### Installing

```
```bash
npm i --save-dev data-snapshot
```

Expand All @@ -40,14 +40,14 @@ test('some-spec', async () => {

The data is never actually expired (to avoid CI unintentionally triggering an Ajax call, etc). However, if you would like to be reminded with a console warning to update your data periodically, set an expires flag.

```
```javascript
const ONE_MONTHISH = 1000 * 60 * 60 * 24 * 30;
dataSnapshot('key', thunkPromise, {expires: Date.now() + ONE_MONTHISH});
```

## API

```
```javascript
dataSnapshot<D>(
name: string,
thunkPromise: () => Promise<D>,
Expand All @@ -59,7 +59,7 @@ dataSnapshot<D>(

## Running the tests

```
```bash
npm test
```

Expand Down
Loading