Skip to content

Commit

Permalink
fix: Create vendor dir and exclude it from coverage (#55)
Browse files Browse the repository at this point in the history
* exclude external-scripts from coverage

* Refactor vendors & include 3pts to index.ts

* Use rootDirs to add vendors

* Update tsconfig.build.json

Co-authored-by: Alex Sanders <[email protected]>

* back to rootDir

* bring back rootDirs

Co-authored-by: Alex Sanders <[email protected]>
  • Loading branch information
ioanna0 and sndrs authored Oct 13, 2020
1 parent 8b6933d commit 85089f8
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
coverage
.DS_Store
4 changes: 1 addition & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ module.exports = {
// coverageDirectory: undefined,

// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "/node_modules/"
// ],
coveragePathIgnorePatterns: ['vendor'],

// Indicates which provider should be used to instrument code for coverage
// coverageProvider: "babel",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { ias } from './third-party-tags/ias';
export { permutive } from './third-party-tags/permutive';
export { fbPixel } from './third-party-tags/facebook-pixel';
export { twitter } from './third-party-tags/twitter-uwt';
export { lotame } from './third-party-tags/lotame';
2 changes: 1 addition & 1 deletion src/third-party-tags/lotame.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { lotameScript } from '../../vendor/lotame-script';
import { GetThirdPartyTag } from '../types';
import { lotameScript } from './external-scripts/lotame-script';

export type LotameData = {
ozoneLotameData: Array<string>;
Expand Down
2 changes: 1 addition & 1 deletion src/third-party-tags/twitter-uwt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { twitterScript } from './external-scripts/twitter-script';
import { twitterScript } from '../../vendor/twitter-script';
import { twitter } from './twitter-uwt';

describe('twitter', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/third-party-tags/twitter-uwt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { twitterScript as insertSnippet } from '../../vendor/twitter-script';
import { GetThirdPartyTag } from '../types';
import { twitterScript as insertSnippet } from './external-scripts/twitter-script';

export const twitter: GetThirdPartyTag = ({ shouldRun }) => ({
shouldRun,
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"declaration": true,
"noEmit": false,
"outDir": "dist",
"rootDir": "src"
"rootDirs": [
"../../vendor",
"src",
]
},
"extends": "./tsconfig.json",
"include": ["src"],
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 85089f8

Please sign in to comment.