Skip to content

Commit

Permalink
The assert in the js import is not right everywhere - get rid of
Browse files Browse the repository at this point in the history
it and try to find where it is actually needed.

Revert " assert { type: 'json' } everywhere"

This reverts commit f296da9.
  • Loading branch information
TheLastCicada committed Nov 8, 2022
1 parent f296da9 commit 3e535d1
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 34 deletions.
14 changes: 7 additions & 7 deletions src/database/seeders/20211209204301-add-projects.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict';

import ProjectStub from '../../models/projects/projects.stub.json' assert { type: 'json' };
import CoBenifetStub from '../../models/co-benefits/co-benefits.stub.json' assert { type: 'json' };
import RelatedProjectStub from '../../models/related-projects/related-projects.stub.json' assert { type: 'json' };
import LabelStub from '../../models/labels/labels.stub.json' assert { type: 'json' };
import RatingsStub from '../../models/ratings/ratings.stub.json' assert { type: 'json' };
import IssuanceStub from '../../models/issuances/issuances.stub.json' assert { type: 'json' };
import LocationsStub from '../../models/locations/locations.stub.json' assert { type: 'json' };
import ProjectStub from '../../models/projects/projects.stub.json';
import CoBenifetStub from '../../models/co-benefits/co-benefits.stub.json';
import RelatedProjectStub from '../../models/related-projects/related-projects.stub.json';
import LabelStub from '../../models/labels/labels.stub.json';
import RatingsStub from '../../models/ratings/ratings.stub.json';
import IssuanceStub from '../../models/issuances/issuances.stub.json';
import LocationsStub from '../../models/locations/locations.stub.json';

export default {
// eslint-disable-next-line no-unused-vars
Expand Down
4 changes: 2 additions & 2 deletions src/database/seeders/20211209205139-add-units.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import UnitStub from '../../models/units/units.stub.json' assert { type: 'json' };
import LabelUnitStub from '../../models/labelUnits/labelUnits.stub.json' assert { type: 'json' };
import UnitStub from '../../models/units/units.stub.json';
import LabelUnitStub from '../../models/labelUnits/labelUnits.stub.json';

export default {
// eslint-disable-next-line no-unused-vars
Expand Down
2 changes: 1 addition & 1 deletion src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
assertDataLayerAvailable,
assertWalletIsAvailable,
} from './utils/data-assertions';
import packageJson from '../package.json' assert { type: 'json' };
import packageJson from '../package.json';
import datalayer from './datalayer';

const { API_KEY, READ_ONLY, IS_GOVERNANCE_BODY, USE_SIMULATOR } =
Expand Down
2 changes: 1 addition & 1 deletion src/models/audit/audit.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './audit.stub.json' assert { type: 'json' };
import stub from './audit.stub.json';

export const AuditMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/co-benefits/co-benefits.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './co-benefits.stub.json' assert { type: 'json' };
import stub from './co-benefits.stub.json';

export const CoBenefitsMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/file-store/file-store.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './file-store.stub.json' assert { type: 'json' };
import stub from './file-store.stub.json';

export const FileStoreMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/issuances/issuances.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './issuances.stub.json' assert { type: 'json' };
import stub from './issuances.stub.json';

export const IssuanceMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/labelUnits/labelUnits.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './labelUnits.stub.json' assert { type: 'json' };
import stub from './labelUnits.stub.json';

export const LabelUnitsMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/labels/labels.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './labels.stub.json' assert { type: 'json' };
import stub from './labels.stub.json';

export const LabelsMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/locations/locations.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './locations.stub.json' assert { type: 'json' };
import stub from './locations.stub.json';

export const LocationMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/meta/meta.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './meta.stub.json' assert { type: 'json' };
import stub from './meta.stub.json';

export const MetaMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/organizations/organizations.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './organizations.stub.json' assert { type: 'json' };
import stub from './organizations.stub.json';

export const OrganizationMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/projects/projects.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './projects.stub.json' assert { type: 'json' };
import stub from './projects.stub.json';

export const ProjectMock = {
findAll: ({ limit, offset }) => stub.slice(offset * limit, (offset + 1) * limit),
Expand Down
2 changes: 1 addition & 1 deletion src/models/ratings/ratings.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './ratings.stub.json' assert { type: 'json' };
import stub from './ratings.stub.json';

export const RatingMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/related-projects/related-projects.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './related-projects.stub.json' assert { type: 'json' };
import stub from './related-projects.stub.json';

export const RelatedProjectMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/simulator/simulator.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './simulator.stub.json' assert { type: 'json' };
import stub from './simulator.stub.json';

export const SimulatorMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/staging/staging.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './staging.stub.json' assert { type: 'json' };
import stub from './staging.stub.json';

export const StagingMock = {
findAll: () => stub,
Expand Down
2 changes: 1 addition & 1 deletion src/models/units/units.mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stub from './units.stub.json' assert { type: 'json' };
import stub from './units.stub.json';

export const UnitMock = {
findAll: ({ limit, offset }) => stub.slice(offset * limit, (offset + 1) * limit),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import path from 'path';
import { logger } from '../config/logger.cjs';

import { getDataModelVersion } from './helpers';
import defaultConfig from './defaultConfig.json' assert { type: 'json' };
import defaultConfig from './defaultConfig.json';

export const getConfig = _.memoize(() => {
const homeDir = os.homedir();
Expand Down
2 changes: 1 addition & 1 deletion src/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import _ from 'lodash';

import { isPluralized } from './string-utils.js';
import { formatModelAssociationName } from './model-utils.js';
import packageJson from '../../package.json' assert { type: 'json' };
import packageJson from '../../package.json';

export const paginationParams = (page, limit) => {
if (page === undefined || limit === undefined) {
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/projects.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as testFixtures from '../test-fixtures';
import sinon from 'sinon';
import datalayer from '../../src/datalayer';
const { expect } = chai;
import newProject from '../test-data/new-project.json' assert { type: 'json' };
import newProject from '../test-data/new-project.json';
import supertest from 'supertest';
import app from '../../src/server';
import { Organization } from '../../src/models/organizations/index.js';
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/staging.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import app from '../../src/server';
import supertest from 'supertest';
import newProject from '../test-data/new-project.json' assert { type: 'json' };
import newProject from '../test-data/new-project.json';
import { pullPickListValues } from '../../src/utils/data-loaders';
import { expect } from 'chai';
import { prepareDb } from '../../src/database';
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/units.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import app from '../../src/server';
import * as testFixtures from '../test-fixtures';
import datalayer from '../../src/datalayer';
import { prepareDb } from '../../src/database';
import newUnit from '../test-data/new-unit.json' assert { type: 'json' };
import newUnit from '../test-data/new-unit.json';
import { pullPickListValues } from '../../src/utils/data-loaders';
const TEST_WAIT_TIME = datalayer.POLLING_INTERVAL * 2;

Expand Down
4 changes: 2 additions & 2 deletions tests/test-fixtures/project-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import chai from 'chai';
const { expect } = chai;

import app from '../../src/server';
import newProject from '../test-data/new-project.json' assert { type: 'json' };
import updateProjectJson from '../test-data/update-project.json' assert { type: 'json' };
import newProject from '../test-data/new-project.json';
import updateProjectJson from '../test-data/update-project.json';
import { ProjectMirror, Project } from '../../src/models';

export const createNewProject = async (payload = newProject) => {
Expand Down
4 changes: 2 additions & 2 deletions tests/test-fixtures/unit-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import chai from 'chai';
const { expect } = chai;

import app from '../../src/server';
import newUnit from '../test-data/new-unit.json' assert { type: 'json' };
import updateUnitJson from '../test-data/update-unit.json' assert { type: 'json' };
import newUnit from '../test-data/new-unit.json';
import updateUnitJson from '../test-data/update-unit.json';
import { UnitMirror, Unit } from '../../src/models';

export const createNewUnit = async (payload = newUnit) => {
Expand Down

0 comments on commit 3e535d1

Please sign in to comment.