Bump @polkadot/dev (#636)

* Bump @polkadot/dev

* Rebump dev

* Add crypto polyfill

* Adjust expectations
This commit is contained in:
Jaco
2022-04-27 09:38:13 +02:00
committed by GitHub
parent dc023fe2c6
commit 16dbecf0d2
11 changed files with 833 additions and 619 deletions
+1
View File
@@ -7,6 +7,7 @@ module.exports = {
...base,
ignorePatterns: [
...base.ignorePatterns,
'jest/**/*',
'**/*.d.ts'
],
parserOptions: {
+1
View File
@@ -12,5 +12,6 @@ module.exports = {
'\\.(css|less)$': 'empty/object',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'empty/object'
},
setupFilesAfterEnv: ['<rootDir>/jest/setupEnv.js'],
testEnvironment: 'jsdom'
};
+10
View File
@@ -0,0 +1,10 @@
// Copyright 2017-2022 @polkadot/ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
const nodeCrypto = require('crypto');
window.crypto = {
getRandomValues: function (buffer) {
return nodeCrypto.randomFillSync(buffer);
}
};
+4 -4
View File
@@ -29,16 +29,16 @@
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/runtime": "^7.17.9",
"@polkadot/dev": "^0.66.9",
"@polkadot/dev": "^0.66.13",
"@polkadot/x-bundle": "^9.0.1",
"@types/jest": "^27.4.1",
"babel-loader": "^8.2.5",
"babel-plugin-transform-vue-template": "^0.4.2",
"empty": "^0.10.1",
"process": "^0.11.10",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-is": "^18.0.0",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-is": "^18.1.0",
"react-native": "^0.68.1",
"stream-browserify": "^3.0.0",
"vue-template-compiler": "^2.6.14",
@@ -9,7 +9,8 @@ describe('identicon', (): void => {
it('generates a basic [0,..,0] identicon', (): void => {
expect(
xmlserializer.serializeToString(
beachballIcon(new Uint8Array(32), { isAlternative: false, size: 256 })
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
beachballIcon(new Uint8Array(32), { isAlternative: false, size: 256 }) as any
)
).toEqual(
'<div xmlns="http://www.w3.org/1999/xhtml" class="" style="background: white; border-radius: 128px; display: inline-block; height: 256px; margin: 0px; overflow: hidden; padding: 0px; width: 256px;"><div class="" style="background: rgb(20, 20, 20); border-radius: 128px; display: inline-block; height: 256px; margin: 0px; overflow: hidden; padding: 0px; width: 256px;"><svg xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="256" height="256"><circle cx="128" cy="140.8" r="128" fill="hsl(212.10000000000002, 65.6%, 55.5%)"/><circle cx="128" cy="153.6" r="102.4" fill="hsl(9.800000000000011, 90.7%, 57.6%)"/><circle cx="128" cy="166.4" r="76.8" fill="hsl(345, 85.7%, 86.3%)"/><circle cx="128" cy="179.2" r="51.2" fill="hsl(261.9, 100%, 87.3%)"/><circle cx="128" cy="192" r="25.6" fill="hsl(345, 100%, 25.1%)"/></svg></div></div>'
@@ -19,7 +20,8 @@ describe('identicon', (): void => {
it('allows overrides', (): void => {
expect(
xmlserializer.serializeToString(
beachballIcon(new Uint8Array(32), { isAlternative: false, size: 100 }, 'testClass', { display: 'block' })
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
beachballIcon(new Uint8Array(32), { isAlternative: false, size: 100 }, 'testClass', { display: 'block' }) as any
)
).toEqual(
'<div xmlns="http://www.w3.org/1999/xhtml" class="testClass" style="background: white; border-radius: 50px; display: block; height: 100px; margin: 0px; overflow: hidden; padding: 0px; width: 100px;"><div class="" style="background: rgb(20, 20, 20); border-radius: 50px; display: inline-block; height: 100px; margin: 0px; overflow: hidden; padding: 0px; width: 100px;"><svg xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="100" height="100"><circle cx="50" cy="55" r="50" fill="hsl(212.10000000000002, 65.6%, 55.5%)"/><circle cx="50" cy="60" r="40" fill="hsl(9.800000000000011, 90.7%, 57.6%)"/><circle cx="50" cy="65" r="30" fill="hsl(345, 85.7%, 86.3%)"/><circle cx="50" cy="70" r="20" fill="hsl(261.9, 100%, 87.3%)"/><circle cx="50" cy="75" r="10" fill="hsl(345, 100%, 25.1%)"/></svg></div></div>'
@@ -10,7 +10,8 @@ describe('circle', (): void => {
it('creates a circle shape', (): void => {
expect(
xmlserializer.serializeToString(
circle(seeder(), 'blue', 50, 2)
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
circle(seeder(), 'blue', 50, 2) as any
)
).toEqual('<circle xmlns="http://www.w3.org/2000/svg" cx="25" cy="32.5" r="15" fill="blue"/>');
});
@@ -9,7 +9,8 @@ describe('circle', (): void => {
it('creates a basic SVG circle element', (): void => {
expect(
serializeToString(
circle(123, 12, 34)
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
circle(123, 12, 34) as any
)
).toEqual('<circle xmlns="http://www.w3.org/2000/svg" cx="12" cy="34" r="123"/>');
});
@@ -9,7 +9,8 @@ describe('element', (): void => {
it('creates a basic SVG element', (): void => {
expect(
serializeToString(
element(123)
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
element(123) as any
)
).toEqual('<svg xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="123" height="123"/>');
});
@@ -9,7 +9,8 @@ describe('rect', (): void => {
it('creates a basic SVG rect element', (): void => {
expect(
serializeToString(
rect(123)
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
rect(123) as any
)
).toEqual('<rect xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="123" height="123" rx="7.6875" ry="7.6875"/>');
});
@@ -9,7 +9,8 @@ describe('svg', (): void => {
it('creates a basic SVG element', (): void => {
expect(
serializeToString(
svg('rect')
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
svg('rect') as any
)
).toEqual('<rect xmlns="http://www.w3.org/2000/svg"/>');
});
+803 -608
View File
File diff suppressed because it is too large Load Diff