Skip to content

Commit

Permalink
Merge pull request #13 from managed-components/action_tests
Browse files Browse the repository at this point in the history
Add Github Action test
  • Loading branch information
tomkln authored Jul 18, 2023
2 parents 434c415 + d24431f commit 209cde2
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: ['prettier'],
env: {
node: true,
browser: true,
worker: true,
es2022: true,
},
rules: {
'prettier/prettier': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true, argsIgnorePattern: '^_' },
],
},
overrides: [
{
files: ['*d.ts'],
rules: {
'no-undef': 'off',
},
},
{
files: ['*js'],
globals: {
webcm: 'writable',
},
},
],
}

24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Build Test'

on:
push:
branches:
- '**'

jobs:
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Running Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# Actual Tests
- run: npm i
- run: npm run lint --if-present
- run: npm run typecheck --if-present
- run: npm run bundle --if-present
2 changes: 1 addition & 1 deletion src/track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentSettings, MCEvent } from '@managed-components/types'
const USER_DATA: Record<string, { hashed?: boolean }> = {
email: { hashed: true },
phone_number: { hashed: true },
external_id: { hashed: true }
external_id: { hashed: true },
}

const getTtclid = (event: MCEvent) => {
Expand Down

0 comments on commit 209cde2

Please sign in to comment.