Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebreak/upgrade-sandbox-to-es6-v2 #6399

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
sourceType: 'unambiguous',
plugins: ['@babel/plugin-syntax-import-assertions'],
env: {
test: {
plugins: ['istanbul'],
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
"@babel/plugin-transform-object-rest-spread": "^7.23.4",
"@babel/plugin-transform-optional-chaining": "^7.23.4",
"@babel/plugin-syntax-import-assertions": "^7.22.5",
"@babel/preset-env": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
Expand Down
5 changes: 3 additions & 2 deletions test/sandbox/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 5,
"ecmaVersion": "latest",
"sourceType": "module"
},
"env": {
"es6": false,
"es6": true,
"node": true
},
"globals": {
Expand Down
3 changes: 3 additions & 0 deletions test/sandbox/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["@babel/plugin-syntax-import-assertions"]
}
6 changes: 2 additions & 4 deletions test/sandbox/constants/referrals.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
module.exports = {
REFERRAL_ID: 'cc5b9953-894c-44b4-a4ac-d0f6a6f6128f',
REFERRAL_ID_NO_CONTACT: 'cc5b9953-894c-44b4-a4ac-d0f6a6f6128d',
}
export const REFERRAL_ID = 'cc5b9953-894c-44b4-a4ac-d0f6a6f6128f'
export const REFERRAL_ID_NO_CONTACT = 'cc5b9953-894c-44b4-a4ac-d0f6a6f6128d'
5 changes: 2 additions & 3 deletions test/sandbox/fixtures/ping.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
module.exports = {
ping: '<?xml version="1.0" encoding="UTF-8"?><pingdom_http_custom_check><status>OK</status></pingdom_http_custom_check>',
}
export const healthcarePing =
'<?xml version="1.0" encoding="UTF-8"?><pingdom_http_custom_check><status>OK</status></pingdom_http_custom_check>'
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var interactionFixture = require('./interaction.json')
import interactionFixture from './interaction.json' assert { type: 'json' }

module.exports = Object.assign({}, interactionFixture, {
export default Object.assign({}, interactionFixture, {
id: '65e984ad-1ad5-4d89-9b12-71cdff5f412c',
subject: 'Interaction without theme',
theme: null,
Expand Down
8 changes: 3 additions & 5 deletions test/sandbox/fixtures/v4/activity-feed/aventri-attendees.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { faker } = require('@faker-js/faker')
import { faker } from '@faker-js/faker'

const futureEventIdWithLargeAttendeeList = 1114
const pastEventIdWithLargeAttendeeList = 1111
Expand Down Expand Up @@ -77,7 +77,7 @@ const generateListOfAttendeesForEvent = (eventId) =>
/**
* Generate an array of aventri attendee hits
*/
const generateAventriAttendeeHits = () => {
export const generateAventriAttendeeHits = () => {
return [
...[
{
Expand Down Expand Up @@ -216,7 +216,7 @@ const generateAventriAttendeeHits = () => {
/**
* Generates a full ES response for aventri attendees
*/
const generateAventriAttendeeESResponse = () => {
export const generateAventriAttendeeESResponse = () => {
const attendees = generateAventriAttendeeHits()
return {
took: 1930,
Expand All @@ -237,5 +237,3 @@ const generateAventriAttendeeESResponse = () => {
},
}
}

module.exports = { generateAventriAttendeeESResponse }
14 changes: 4 additions & 10 deletions test/sandbox/fixtures/v4/activity-feed/aventri-events.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { faker } = require('@faker-js/faker')
import { faker } from '@faker-js/faker'

const generateAventriEvent = (
export const generateAventriEvent = (
{
id,
name,
Expand Down Expand Up @@ -95,7 +95,7 @@ const generateAventriEvent = (
/**
* Generate an array of aventri event hits
*/
const generateAventriEventHits = (additionalEventCount = 0) => {
export const generateAventriEventHits = (additionalEventCount = 0) => {
return [
...[
{
Expand Down Expand Up @@ -156,7 +156,7 @@ const generateAventriEventHits = (additionalEventCount = 0) => {
/**
* Generates a full ES response for aventri events
*/
const generateAventriEventESResponse = (additionalEventCount = 0) => {
export const generateAventriEventESResponse = (additionalEventCount = 0) => {
const events = generateAventriEventHits(additionalEventCount)
return {
took: 1930,
Expand All @@ -177,9 +177,3 @@ const generateAventriEventESResponse = (additionalEventCount = 0) => {
},
}
}

module.exports = {
generateAventriEvent,
generateAventriEventESResponse,
generateAventriEventHits,
}
14 changes: 4 additions & 10 deletions test/sandbox/fixtures/v4/activity-feed/data-hub-activities.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { generateAventriEventHits } = require('./aventri-events')
import { generateAventriEventHits } from './aventri-events.js'

const generateInvestment = () => ({
export const generateInvestment = () => ({
_index: 'activities__feed_id_datahub',
_type: '_doc',
_id: 'dit:DataHubInvestmentProject:d9e25847-6199-e211-a939-e4115bead28a:Add',
Expand Down Expand Up @@ -43,7 +43,7 @@ const generateInvestment = () => ({
},
})

const generateInteraction = () => ({
export const generateInteraction = () => ({
_index:
'activities__feed_id_datahub-interactions__date_2019-06-20__timestamp_1561034480__batch_id_xputyeio__',
_type: '_doc',
Expand Down Expand Up @@ -102,7 +102,7 @@ const generateInteraction = () => ({
sort: [1560787348796],
})

const generateDataHubActivitiesESResponse = () => ({
export const generateDataHubActivitiesESResponse = () => ({
took: 15,
timed_out: false,
_shards: {
Expand All @@ -124,9 +124,3 @@ const generateDataHubActivitiesESResponse = () => ({
],
},
})

module.exports = {
generateDataHubActivitiesESResponse,
generateInvestment,
generateInteraction,
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
import companywithInvestment1 from './company-with-investment-1.json' assert { type: 'json' }
import companywithInvestment2 from './company-with-investment-2.json' assert { type: 'json' }

export default {
count: 2,
next: null,
previous: null,
results: [
require('./company-with-investment-1.json'),
require('./company-with-investment-2.json'),
],
results: [companywithInvestment1, companywithInvestment2],
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
import dnbGlobalUltimate from './company-dnb-global-ultimate.json' assert { type: 'json' }
import dnbGlobalSubsidiary from './company-dnb-subsidiary.json' assert { type: 'json' }
import dnbLtd from './company-dnb-ltd.json' assert { type: 'json' }

export default {
count: 3,
next: null,
previous: null,
results: [
require('./company-dnb-global-ultimate.json'),
require('./company-dnb-subsidiary.json'),
require('./company-dnb-ltd.json'),
],
results: [dnbGlobalUltimate, dnbGlobalSubsidiary, dnbLtd],
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var interactionFixture = require('./interaction.json')
import interactionFixture from './interaction.json' assert { type: 'json' }

module.exports = Object.assign({}, interactionFixture, {
export default Object.assign({}, interactionFixture, {
id: '65e984ad-1ad5-4d89-9b12-71cdff5f412c',
subject: 'Interaction without theme',
theme: null,
Expand Down
4 changes: 2 additions & 2 deletions test/sandbox/fixtures/v4/referrals/referral-list.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var whoami = require('../../../fixtures/whoami.json')
import whoami from '../../../fixtures/whoami.json' assert { type: 'json' }

module.exports = [
export default [
{
id: 'aaa',
status: 'outstanding',
Expand Down
Loading