mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-10 01:16:39 +02:00
task: use swc instead of ts-jest (#2042)
This commit is contained in:
parent
03ddb0ad74
commit
8648649047
11
package.json
11
package.json
@ -57,7 +57,9 @@
|
||||
"testTimeout": 10000,
|
||||
"globalSetup": "./scripts/jest-setup.js",
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
"^.+\\.tsx?$": [
|
||||
"@swc/jest"
|
||||
]
|
||||
},
|
||||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||
"testPathIgnorePatterns": [
|
||||
@ -138,7 +140,7 @@
|
||||
"@types/express": "4.17.13",
|
||||
"@types/express-session": "1.17.5",
|
||||
"@types/faker": "5.5.9",
|
||||
"@types/jest": "27.5.2",
|
||||
"@types/jest": "29.0.0",
|
||||
"@types/js-yaml": "4.0.5",
|
||||
"@types/make-fetch-happen": "10.0.0",
|
||||
"@types/memoizee": "0.4.8",
|
||||
@ -166,7 +168,7 @@
|
||||
"fast-check": "3.1.2",
|
||||
"fetch-mock": "9.11.0",
|
||||
"husky": "8.0.1",
|
||||
"jest": "27.5.1",
|
||||
"jest": "29.0.1",
|
||||
"lint-staged": "13.0.3",
|
||||
"nock": "13.2.9",
|
||||
"prettier": "2.7.1",
|
||||
@ -174,7 +176,8 @@
|
||||
"source-map-support": "0.5.21",
|
||||
"superagent": "8.0.0",
|
||||
"supertest": "6.2.4",
|
||||
"ts-jest": "27.1.5",
|
||||
"@swc/core": "1.2.246",
|
||||
"@swc/jest": "0.2.22",
|
||||
"ts-node": "10.9.1",
|
||||
"tsc-watch": "5.0.3",
|
||||
"typescript": "4.8.2"
|
||||
|
@ -1,26 +1,26 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`should create default config 1`] = `
|
||||
Object {
|
||||
"additionalCspAllowedDomains": Object {
|
||||
"defaultSrc": Array [],
|
||||
"fontSrc": Array [],
|
||||
"imgSrc": Array [],
|
||||
"scriptSrc": Array [],
|
||||
"styleSrc": Array [],
|
||||
{
|
||||
"additionalCspAllowedDomains": {
|
||||
"defaultSrc": [],
|
||||
"fontSrc": [],
|
||||
"imgSrc": [],
|
||||
"scriptSrc": [],
|
||||
"styleSrc": [],
|
||||
},
|
||||
"authentication": Object {
|
||||
"authentication": {
|
||||
"createAdminUser": true,
|
||||
"customAuthHandler": [Function],
|
||||
"enableApiToken": true,
|
||||
"initApiTokens": Array [],
|
||||
"initApiTokens": [],
|
||||
"type": "open-source",
|
||||
},
|
||||
"clientFeatureCaching": Object {
|
||||
"clientFeatureCaching": {
|
||||
"enabled": true,
|
||||
"maxAge": 600,
|
||||
},
|
||||
"db": Object {
|
||||
"db": {
|
||||
"acquireConnectionTimeout": 30000,
|
||||
"applicationName": "unleash",
|
||||
"database": "unleash_db",
|
||||
@ -28,7 +28,7 @@ Object {
|
||||
"driver": "postgres",
|
||||
"host": "localhost",
|
||||
"password": "password",
|
||||
"pool": Object {
|
||||
"pool": {
|
||||
"idleTimeoutMillis": 30000,
|
||||
"max": 4,
|
||||
"min": 0,
|
||||
@ -36,14 +36,14 @@ Object {
|
||||
},
|
||||
"port": 4242,
|
||||
"schema": "public",
|
||||
"ssl": Object {
|
||||
"ssl": {
|
||||
"rejectUnauthorized": false,
|
||||
},
|
||||
"user": "unleash",
|
||||
"version": undefined,
|
||||
},
|
||||
"disableLegacyFeaturesApi": false,
|
||||
"email": Object {
|
||||
"email": {
|
||||
"host": undefined,
|
||||
"port": 587,
|
||||
"secure": false,
|
||||
@ -53,19 +53,19 @@ Object {
|
||||
},
|
||||
"enableOAS": false,
|
||||
"enterpriseVersion": undefined,
|
||||
"environmentEnableOverrides": Array [],
|
||||
"environmentEnableOverrides": [],
|
||||
"eventBus": EventEmitter {
|
||||
"_events": Object {},
|
||||
"_events": {},
|
||||
"_eventsCount": 0,
|
||||
"_maxListeners": undefined,
|
||||
Symbol(kCapture): false,
|
||||
},
|
||||
"eventHook": undefined,
|
||||
"experimental": Object {
|
||||
"externalResolver": Object {
|
||||
"experimental": {
|
||||
"externalResolver": {
|
||||
"isEnabled": [Function],
|
||||
},
|
||||
"flags": Object {
|
||||
"flags": {
|
||||
"ENABLE_DARK_MODE_SUPPORT": false,
|
||||
"anonymiseEventLog": false,
|
||||
"batchMetrics": false,
|
||||
@ -74,28 +74,28 @@ Object {
|
||||
},
|
||||
},
|
||||
"flagResolver": FlagResolver {
|
||||
"experiments": Object {
|
||||
"experiments": {
|
||||
"ENABLE_DARK_MODE_SUPPORT": false,
|
||||
"anonymiseEventLog": false,
|
||||
"batchMetrics": false,
|
||||
"embedProxy": false,
|
||||
"embedProxyFrontend": false,
|
||||
},
|
||||
"externalResolver": Object {
|
||||
"externalResolver": {
|
||||
"isEnabled": [Function],
|
||||
},
|
||||
},
|
||||
"frontendApiOrigins": Array [
|
||||
"frontendApiOrigins": [
|
||||
"*",
|
||||
],
|
||||
"getLogger": [Function],
|
||||
"import": Object {
|
||||
"import": {
|
||||
"dropBeforeImport": false,
|
||||
"file": undefined,
|
||||
"keepExisting": false,
|
||||
},
|
||||
"inlineSegmentConstraints": true,
|
||||
"listen": Object {
|
||||
"listen": {
|
||||
"host": undefined,
|
||||
"port": 4242,
|
||||
},
|
||||
@ -103,7 +103,7 @@ Object {
|
||||
"preRouterHook": undefined,
|
||||
"secureHeaders": false,
|
||||
"segmentValuesLimit": 100,
|
||||
"server": Object {
|
||||
"server": {
|
||||
"baseUriPath": "",
|
||||
"cdnPrefix": undefined,
|
||||
"enableRequestLogger": false,
|
||||
@ -118,20 +118,20 @@ Object {
|
||||
"serverMetrics": true,
|
||||
"unleashUrl": "http://localhost:4242",
|
||||
},
|
||||
"session": Object {
|
||||
"session": {
|
||||
"clearSiteDataOnLogout": true,
|
||||
"cookieName": "unleash-session",
|
||||
"db": true,
|
||||
"ttlHours": 48,
|
||||
},
|
||||
"strategySegmentsLimit": 5,
|
||||
"ui": Object {
|
||||
"flags": Object {
|
||||
"ui": {
|
||||
"flags": {
|
||||
"E": true,
|
||||
"ENABLE_DARK_MODE_SUPPORT": false,
|
||||
},
|
||||
},
|
||||
"versionCheck": Object {
|
||||
"versionCheck": {
|
||||
"enable": true,
|
||||
"url": "https://version.unleash.run",
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Should call datadog webhook for archived toggle 1`] = `"{\\"text\\":\\"%%% \\\\n some@user.com just archived feature toggle *[some-toggle](http://some-url.com/archive)* \\\\n %%% \\",\\"title\\":\\"Unleash notification update\\"}"`;
|
||||
exports[`Should call datadog webhook for archived toggle 1`] = `"{"text":"%%% \\n some@user.com just archived feature toggle *[some-toggle](http://some-url.com/archive)* \\n %%% ","title":"Unleash notification update"}"`;
|
||||
|
||||
exports[`Should call datadog webhook 1`] = `"{\\"text\\":\\"%%% \\\\n some@user.com created feature toggle [some-toggle](http://some-url.com/projects//some-toggle) in project *undefined* \\\\n %%% \\",\\"title\\":\\"Unleash notification update\\"}"`;
|
||||
exports[`Should call datadog webhook 1`] = `"{"text":"%%% \\n some@user.com created feature toggle [some-toggle](http://some-url.com/projects//some-toggle) in project *undefined* \\n %%% ","title":"Unleash notification update"}"`;
|
||||
|
||||
exports[`Should call datadog webhook for toggled environment 1`] = `"{\\"text\\":\\"%%% \\\\n some@user.com *disabled* [some-toggle](http://some-url.com/projects/default/some-toggle) in *development* environment in project *default* \\\\n %%% \\",\\"title\\":\\"Unleash notification update\\"}"`;
|
||||
exports[`Should call datadog webhook for toggled environment 1`] = `"{"text":"%%% \\n some@user.com *disabled* [some-toggle](http://some-url.com/projects/default/some-toggle) in *development* environment in project *default* \\n %%% ","title":"Unleash notification update"}"`;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Should call slack webhook 1`] = `"{\\"username\\":\\"Unleash\\",\\"icon_emoji\\":\\":unleash:\\",\\"text\\":\\"some@user.com created feature toggle <http://some-url.com/projects/default/some-toggle|some-toggle> in project *default*\\",\\"channel\\":\\"#undefined\\",\\"attachments\\":[{\\"actions\\":[{\\"name\\":\\"featureToggle\\",\\"text\\":\\"Open in Unleash\\",\\"type\\":\\"button\\",\\"value\\":\\"featureToggle\\",\\"style\\":\\"primary\\",\\"url\\":\\"http://some-url.com/projects/default/some-toggle\\"}]}]}"`;
|
||||
exports[`Should call slack webhook 1`] = `"{"username":"Unleash","icon_emoji":":unleash:","text":"some@user.com created feature toggle <http://some-url.com/projects/default/some-toggle|some-toggle> in project *default*","channel":"#undefined","attachments":[{"actions":[{"name":"featureToggle","text":"Open in Unleash","type":"button","value":"featureToggle","style":"primary","url":"http://some-url.com/projects/default/some-toggle"}]}]}"`;
|
||||
|
||||
exports[`Should call slack webhook for archived toggle 1`] = `"{\\"username\\":\\"Unleash\\",\\"icon_emoji\\":\\":unleash:\\",\\"text\\":\\" some@user.com just archived feature toggle *<http://some-url.com/archive|some-toggle>*\\",\\"channel\\":\\"#undefined\\",\\"attachments\\":[{\\"actions\\":[{\\"name\\":\\"featureToggle\\",\\"text\\":\\"Open in Unleash\\",\\"type\\":\\"button\\",\\"value\\":\\"featureToggle\\",\\"style\\":\\"primary\\",\\"url\\":\\"http://some-url.com/archive\\"}]}]}"`;
|
||||
exports[`Should call slack webhook for archived toggle 1`] = `"{"username":"Unleash","icon_emoji":":unleash:","text":" some@user.com just archived feature toggle *<http://some-url.com/archive|some-toggle>*","channel":"#undefined","attachments":[{"actions":[{"name":"featureToggle","text":"Open in Unleash","type":"button","value":"featureToggle","style":"primary","url":"http://some-url.com/archive"}]}]}"`;
|
||||
|
||||
exports[`Should call webhook for toggled environment 1`] = `"{\\"username\\":\\"Unleash\\",\\"icon_emoji\\":\\":unleash:\\",\\"text\\":\\"some@user.com *disabled* <http://some-url.com/projects/default/some-toggle|some-toggle> in *development* environment in project *default*\\",\\"channel\\":\\"#undefined\\",\\"attachments\\":[{\\"actions\\":[{\\"name\\":\\"featureToggle\\",\\"text\\":\\"Open in Unleash\\",\\"type\\":\\"button\\",\\"value\\":\\"featureToggle\\",\\"style\\":\\"primary\\",\\"url\\":\\"http://some-url.com/projects/default/some-toggle\\"}]}]}"`;
|
||||
exports[`Should call webhook for toggled environment 1`] = `"{"username":"Unleash","icon_emoji":":unleash:","text":"some@user.com *disabled* <http://some-url.com/projects/default/some-toggle|some-toggle> in *development* environment in project *default*","channel":"#undefined","attachments":[{"actions":[{"name":"featureToggle","text":"Open in Unleash","type":"button","value":"featureToggle","style":"primary","url":"http://some-url.com/projects/default/some-toggle"}]}]}"`;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Should call teams webhook 1`] = `"{\\"themeColor\\":\\"0076D7\\",\\"summary\\":\\"Message\\",\\"sections\\":[{\\"activityTitle\\":\\"some@user.com created feature toggle [some-toggle](http://some-url.com/projects//some-toggle) in project *undefined*\\",\\"activitySubtitle\\":\\"Unleash notification update\\",\\"facts\\":[{\\"name\\":\\"User\\",\\"value\\":\\"some@user.com\\"},{\\"name\\":\\"Action\\",\\"value\\":\\"feature-created\\"}]}],\\"potentialAction\\":[{\\"@type\\":\\"OpenUri\\",\\"name\\":\\"Go to feature\\",\\"targets\\":[{\\"os\\":\\"default\\",\\"uri\\":\\"http://some-url.com/projects//some-toggle\\"}]}]}"`;
|
||||
exports[`Should call teams webhook 1`] = `"{"themeColor":"0076D7","summary":"Message","sections":[{"activityTitle":"some@user.com created feature toggle [some-toggle](http://some-url.com/projects//some-toggle) in project *undefined*","activitySubtitle":"Unleash notification update","facts":[{"name":"User","value":"some@user.com"},{"name":"Action","value":"feature-created"}]}],"potentialAction":[{"@type":"OpenUri","name":"Go to feature","targets":[{"os":"default","uri":"http://some-url.com/projects//some-toggle"}]}]}"`;
|
||||
|
||||
exports[`Should call teams webhook for archived toggle 1`] = `"{\\"themeColor\\":\\"0076D7\\",\\"summary\\":\\"Message\\",\\"sections\\":[{\\"activityTitle\\":\\" some@user.com just archived feature toggle *[some-toggle](http://some-url.com/archive)*\\",\\"activitySubtitle\\":\\"Unleash notification update\\",\\"facts\\":[{\\"name\\":\\"User\\",\\"value\\":\\"some@user.com\\"},{\\"name\\":\\"Action\\",\\"value\\":\\"feature-archived\\"}]}],\\"potentialAction\\":[{\\"@type\\":\\"OpenUri\\",\\"name\\":\\"Go to feature\\",\\"targets\\":[{\\"os\\":\\"default\\",\\"uri\\":\\"http://some-url.com/archive\\"}]}]}"`;
|
||||
exports[`Should call teams webhook for archived toggle 1`] = `"{"themeColor":"0076D7","summary":"Message","sections":[{"activityTitle":" some@user.com just archived feature toggle *[some-toggle](http://some-url.com/archive)*","activitySubtitle":"Unleash notification update","facts":[{"name":"User","value":"some@user.com"},{"name":"Action","value":"feature-archived"}]}],"potentialAction":[{"@type":"OpenUri","name":"Go to feature","targets":[{"os":"default","uri":"http://some-url.com/archive"}]}]}"`;
|
||||
|
||||
exports[`Should call teams webhook for toggled environment 1`] = `"{\\"themeColor\\":\\"0076D7\\",\\"summary\\":\\"Message\\",\\"sections\\":[{\\"activityTitle\\":\\"some@user.com *disabled* [some-toggle](http://some-url.com/projects/default/some-toggle) in *development* environment in project *default*\\",\\"activitySubtitle\\":\\"Unleash notification update\\",\\"facts\\":[{\\"name\\":\\"User\\",\\"value\\":\\"some@user.com\\"},{\\"name\\":\\"Action\\",\\"value\\":\\"feature-environment-disabled\\"}]}],\\"potentialAction\\":[{\\"@type\\":\\"OpenUri\\",\\"name\\":\\"Go to feature\\",\\"targets\\":[{\\"os\\":\\"default\\",\\"uri\\":\\"http://some-url.com/projects/default/some-toggle\\"}]}]}"`;
|
||||
exports[`Should call teams webhook for toggled environment 1`] = `"{"themeColor":"0076D7","summary":"Message","sections":[{"activityTitle":"some@user.com *disabled* [some-toggle](http://some-url.com/projects/default/some-toggle) in *development* environment in project *default*","activitySubtitle":"Unleash notification update","facts":[{"name":"User","value":"some@user.com"},{"name":"Action","value":"feature-environment-disabled"}]}],"potentialAction":[{"@type":"OpenUri","name":"Go to feature","targets":[{"os":"default","uri":"http://some-url.com/projects/default/some-toggle"}]}]}"`;
|
||||
|
@ -29,7 +29,7 @@ test('all schema $id attributes should have the expected format', () => {
|
||||
test('removeJsonSchemaProps', () => {
|
||||
expect(removeJsonSchemaProps({ a: 'b', $id: 'c', components: {} }))
|
||||
.toMatchInlineSnapshot(`
|
||||
Object {
|
||||
{
|
||||
"a": "b",
|
||||
}
|
||||
`);
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`apiTokenSchema empty 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'username'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "username",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`changePasswordSchema empty 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'token'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "token",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`clientApplicationSchema no fields 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'appName'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "appName",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`clientFeaturesSchema no fields 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'version'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "version",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`clientMetricsSchema should fail when required field is missing 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/bucket",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'stop'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "stop",
|
||||
},
|
||||
"schemaPath": "#/properties/bucket/required",
|
||||
|
@ -1,14 +1,14 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`constraintSchema invalid operator name 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/operator",
|
||||
"keyword": "enum",
|
||||
"message": "must be equal to one of the allowed values",
|
||||
"params": Object {
|
||||
"allowedValues": Array [
|
||||
"params": {
|
||||
"allowedValues": [
|
||||
"NOT_IN",
|
||||
"IN",
|
||||
"STR_ENDS_WITH",
|
||||
@ -34,13 +34,13 @@ Object {
|
||||
`;
|
||||
|
||||
exports[`constraintSchema invalid value type 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/value",
|
||||
"keyword": "type",
|
||||
"message": "must be string",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"type": "string",
|
||||
},
|
||||
"schemaPath": "#/properties/value/type",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`contextFieldSchema empty 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'name'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "name",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`emailSchema 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'email'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "email",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`featureEnvironmentSchema empty 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'name'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "name",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`featureSchema constraints 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/strategies/0/constraints/0",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'operator'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "operator",
|
||||
},
|
||||
"schemaPath": "#/components/schemas/constraintSchema/required",
|
||||
@ -18,13 +18,13 @@ Object {
|
||||
`;
|
||||
|
||||
exports[`featureSchema variant override values must be an array 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/variants/0/overrides/0/values",
|
||||
"keyword": "type",
|
||||
"message": "must be array",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"type": "array",
|
||||
},
|
||||
"schemaPath": "#/components/schemas/overrideSchema/properties/values/type",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`featureTypeSchema empty 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'id'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "id",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`meSchema empty 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'user'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "user",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
@ -18,13 +18,13 @@ Object {
|
||||
`;
|
||||
|
||||
exports[`meSchema missing permissions 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'permissions'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "permissions",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
@ -35,13 +35,13 @@ Object {
|
||||
`;
|
||||
|
||||
exports[`meSchema missing splash 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'splash'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "splash",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`roleSchema 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'id'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "id",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`setStrategySortOrderSchema missing id 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/0",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'id'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "id",
|
||||
},
|
||||
"schemaPath": "#/items/required",
|
||||
@ -18,13 +18,13 @@ Object {
|
||||
`;
|
||||
|
||||
exports[`setStrategySortOrderSchema missing sortOrder 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/0",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'sortOrder'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "sortOrder",
|
||||
},
|
||||
"schemaPath": "#/items/required",
|
||||
@ -35,13 +35,13 @@ Object {
|
||||
`;
|
||||
|
||||
exports[`setStrategySortOrderSchema no additional parameters 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/1",
|
||||
"keyword": "additionalProperties",
|
||||
"message": "must NOT have additional properties",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"additionalProperty": "extra",
|
||||
},
|
||||
"schemaPath": "#/items/additionalProperties",
|
||||
@ -52,13 +52,13 @@ Object {
|
||||
`;
|
||||
|
||||
exports[`setStrategySortOrderSchema wrong sortOrder type 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/0/sortOrder",
|
||||
"keyword": "type",
|
||||
"message": "must be number",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"type": "number",
|
||||
},
|
||||
"schemaPath": "#/items/properties/sortOrder/type",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`sortOrderSchema invalid value type 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "/a",
|
||||
"keyword": "type",
|
||||
"message": "must be number",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"type": "number",
|
||||
},
|
||||
"schemaPath": "#/additionalProperties/type",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`strategySchema 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'name'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "name",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`tokenUserSchema 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'id'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "id",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`validatePasswordSchema empty 1`] = `
|
||||
Object {
|
||||
"errors": Array [
|
||||
Object {
|
||||
{
|
||||
"errors": [
|
||||
{
|
||||
"instancePath": "",
|
||||
"keyword": "required",
|
||||
"message": "must have required property 'password'",
|
||||
"params": Object {
|
||||
"params": {
|
||||
"missingProperty": "password",
|
||||
},
|
||||
"schemaPath": "#/required",
|
||||
|
@ -2,10 +2,10 @@ import { createRequestSchema } from './create-request-schema';
|
||||
|
||||
test('createRequestSchema', () => {
|
||||
expect(createRequestSchema('schemaName')).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"content": Object {
|
||||
"application/json": Object {
|
||||
"schema": Object {
|
||||
{
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/schemaName",
|
||||
},
|
||||
},
|
||||
|
@ -2,10 +2,10 @@ import { createResponseSchema } from './create-response-schema';
|
||||
|
||||
test('createResponseSchema', () => {
|
||||
expect(createResponseSchema('schemaName')).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"content": Object {
|
||||
"application/json": Object {
|
||||
"schema": Object {
|
||||
{
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/schemaName",
|
||||
},
|
||||
},
|
||||
|
@ -39,7 +39,7 @@ function flushPromises() {
|
||||
}
|
||||
|
||||
test('Multiple registrations of same appname and instanceid within same time period should only cause one registration', async () => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
const appStoreSpy = jest.fn();
|
||||
const bulkSpy = jest.fn();
|
||||
const clientApplicationsStore: any = {
|
||||
@ -88,7 +88,7 @@ test('Multiple registrations of same appname and instanceid within same time per
|
||||
});
|
||||
|
||||
test('Multiple unique clients causes multiple registrations', async () => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
const appStoreSpy = jest.fn();
|
||||
const bulkSpy = jest.fn();
|
||||
const clientApplicationsStore: any = {
|
||||
@ -139,7 +139,7 @@ test('Multiple unique clients causes multiple registrations', async () => {
|
||||
jest.useRealTimers();
|
||||
});
|
||||
test('Same client registered outside of dedup interval will be registered twice', async () => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
const appStoreSpy = jest.fn();
|
||||
const bulkSpy = jest.fn();
|
||||
const clientApplicationsStore: any = {
|
||||
@ -195,7 +195,7 @@ test('Same client registered outside of dedup interval will be registered twice'
|
||||
});
|
||||
|
||||
test('No registrations during a time period will not call stores', async () => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
const appStoreSpy = jest.fn();
|
||||
const bulkSpy = jest.fn();
|
||||
const clientApplicationsStore: any = {
|
||||
|
@ -17,7 +17,7 @@ test('should calculate the correct time in seconds', () => {
|
||||
});
|
||||
|
||||
test('timer should track the time', async () => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
const tt = timer.new();
|
||||
let diff;
|
||||
timeout(() => {
|
||||
|
@ -39,7 +39,7 @@ test('should register client', async () => {
|
||||
|
||||
test('should allow client to register multiple times', async () => {
|
||||
expect.assertions(2);
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
const { clientInstanceStore, clientApplicationsStore } = db.stores;
|
||||
|
||||
const clientRegistration = {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -31,7 +31,7 @@ afterAll(async () => {
|
||||
}
|
||||
});
|
||||
test('Should include id and createdAt when saving', async () => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
const event1 = {
|
||||
type: APPLICATION_CREATED,
|
||||
createdBy: '127.0.0.1',
|
||||
@ -79,7 +79,7 @@ test('Should include empty tags array for new event', async () => {
|
||||
});
|
||||
|
||||
test('Should be able to store multiple events at once', async () => {
|
||||
jest.useFakeTimers('modern');
|
||||
jest.useFakeTimers();
|
||||
const event1 = {
|
||||
type: APPLICATION_CREATED,
|
||||
createdBy: '127.0.0.1',
|
||||
|
Loading…
Reference in New Issue
Block a user