@financial-times/ads-moat-integration
Advanced tools
Comparing version 3.1.0 to 3.2.0
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
"@babel/preset-env", | ||
{ | ||
targets: { | ||
node: 8 | ||
} | ||
} | ||
] | ||
node: 12, | ||
ie: "11", | ||
}, | ||
}, | ||
], | ||
], | ||
plugins: [] | ||
} | ||
plugins: ["@babel/plugin-proposal-optional-chaining"], | ||
}; |
{ | ||
"name": "@financial-times/ads-moat-integration", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "", | ||
"main": "dist/client.js", | ||
"module": "dist/ads-moat-integration.es.js", | ||
"main": "dist/ads-moat-integration.umd.js", | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@babel/core": "^7.4.5", | ||
"@babel/plugin-transform-react-jsx": "^7.3.0", | ||
"@babel/preset-env": "^7.4.5", | ||
"jest": "^26.0.0", | ||
"@babel/core": "7.15.0", | ||
"@babel/plugin-proposal-optional-chaining": "7.14.5", | ||
"@babel/plugin-transform-react-jsx": "7.14.9", | ||
"@babel/preset-env": "7.15.0", | ||
"@rollup/plugin-babel": "5.3.0", | ||
"@rollup/plugin-node-resolve": "13.0.4", | ||
"jest": "27.0.6", | ||
"jest-fetch-mock": "^3.0.3", | ||
"regenerator-runtime": "^0.13.7", | ||
"rollup": "^2.0.0", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-serve": "^1.0.1" | ||
"rollup": "2.56.3" | ||
}, | ||
@@ -19,0 +20,0 @@ "scripts": { |
@@ -0,10 +1,27 @@ | ||
import resolve from "@rollup/plugin-node-resolve"; | ||
import babel from "@rollup/plugin-babel"; | ||
import pkg from "./package.json"; | ||
const config = { | ||
input: "src/index.js", | ||
plugins: [resolve(), babel({ babelHelpers: "bundled" })], | ||
}; | ||
export default [ | ||
{ | ||
input: { | ||
client: 'src/client/index', | ||
...config, | ||
output: { | ||
file: pkg.main, | ||
format: "cjs", | ||
exports: "named", | ||
}, | ||
}, | ||
{ | ||
...config, | ||
output: { | ||
dir: 'dist' | ||
file: pkg.module, | ||
format: "es", | ||
}, | ||
} | ||
] | ||
}, | ||
]; |
@@ -0,20 +1,26 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
/* eslint-disable no-console */ | ||
import moatIntegration from '../src/client' | ||
import moatIntegration from "../src"; | ||
describe('moatIntegration', () => { | ||
afterEach(() => { | ||
const script = document.getElementById('n-ads-moat'); | ||
script && script.remove(); | ||
}) | ||
describe("moatIntegration", () => { | ||
afterEach(() => { | ||
const script = document.getElementById("n-ads-moat"); | ||
script && script.remove(); | ||
}); | ||
test('default export should be a function', () => { | ||
expect(typeof moatIntegration).toEqual('function') | ||
}); | ||
test('should append a script to the HEAD', () => { | ||
moatIntegration(); | ||
const script = document.getElementById('n-ads-moat'); | ||
expect(script).not.toBe(null); | ||
expect(script.getAttribute('src')).toBe('https://z.moatads.com/financialtimesprebidheader859796398452/moatheader.js'); | ||
}); | ||
}) | ||
test("default export should be a function", () => { | ||
expect(typeof moatIntegration).toEqual("function"); | ||
}); | ||
test("should append a script to the HEAD", () => { | ||
moatIntegration(); | ||
const script = document.getElementById("n-ads-moat"); | ||
expect(script).not.toBe(null); | ||
expect(script.getAttribute("src")).toBe( | ||
"https://z.moatads.com/financialtimesprebidheader859796398452/moatheader.js" | ||
); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17410
445
1