Skip to content

Commit

Permalink
Merge pull request #7 from cbschuld/workflow_esm
Browse files Browse the repository at this point in the history
workflow esm
  • Loading branch information
cbschuld authored Jul 5, 2022
2 parents 307d402 + 585ba90 commit 40c9ef7
Show file tree
Hide file tree
Showing 7 changed files with 3,571 additions and 8,500 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on: [push]

jobs:
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Package to npmjs
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 10 additions & 3 deletions __tests__/v4.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { v4 as uuid } from '../src/uuid/v4';

test('v4 calculation', () => {
expect(uuid().length).toBeGreaterThan(20);
});
describe('v4 testing', ()=> {
test('calculation', () => {
expect(uuid().length).toBeGreaterThan(20);
});
test('simplistic unique check', () => {
const uuid1 = uuid();
const uuid2 = uuid();
expect(uuid1).not.toBe(uuid2);
});
})
Loading

0 comments on commit 40c9ef7

Please sign in to comment.