Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jspm_packages
template.drawio.bak

# schemas
schema.*.mjs
schema.*.js

# build
dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DynamoDbAdapter } from '../../../src/common/adapters/DynamoDbAdapter.mjs'
import { DynamoDbAdapter } from '../../../src/common/adapters/DynamoDbAdapter.js'

describe('DynamoDB Adapter', () => {
it('should query by field', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MyEntity } from '../../../src/common/entities/MyEntity.mjs'
import { MyEntity } from '../../../src/common/entities/MyEntity.js'

describe('My Entity', () => {
it('should be created from parameters', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MyEntityService } from '../../../src/common/services/MyEntityService.mjs'
import { MyEntityService } from '../../../src/common/services/MyEntityService.js'

describe('MyEntity service', () => {
it('should create and save new entity', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { performCalculation } from '../../src/createItem/businessLogic.mjs'
import { performCalculation } from '../../src/createItem/businessLogic.js'

describe('Creat Item buiness logic suite', () => {
it('should add numbers', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import IamTestHelper from 'serverless-iam-test-helper';

import { MyEntityService } from '../../src/common/services/MyEntityService.mjs'
import { DynamoDbAdapter } from '../../src/common/adapters/DynamoDbAdapter.mjs';
import { MyEntityService } from '../../src/common/services/MyEntityService.js'
import { DynamoDbAdapter } from '../../src/common/adapters/DynamoDbAdapter.js';

const cleanup = []

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import IamTestHelper from 'serverless-iam-test-helper';

import { MyEntityService } from '../../src/common/services/MyEntityService.mjs';
import { MyEntityService } from '../../src/common/services/MyEntityService.js';

describe('ProcessItem Lambda IAM Role', () => {
beforeAll(async () => {
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env bash

# This build script finds all files with name in format schema.*.json and pre-transpiles the schemas
# from json into mjs files using ajv-cmd. The output files are in the same directory as the source
# from json into js files using ajv-cmd. The output files are in the same directory as the source
# json files. They have the same name but different extension.

bundle () {
ajv validate ${1} --valid \
--strict true --coerce-types array --all-errors true --use-defaults empty
ajv transpile ${1} \
--strict true --coerce-types array --all-errors true --use-defaults empty -o ${1%.json}.mjs
--strict true --coerce-types array --all-errors true --use-defaults empty -o ${1%.json}.js
}

for file in src/*/schema.*.json; do
Expand Down
2 changes: 1 addition & 1 deletion config/e2e.jest.config.mjs → config/e2e.jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as dotenv from 'dotenv';
export default {
testEnvironment: 'node',
roots: ['../__tests__/'],
testMatch: ['**/*.(e2e).mjs'],
testMatch: ['**/*.(e2e).js'],
testTimeout: 60000 * 7, // 7 minutes timeout
// Enable this if you're using aws-testing-library
setupFilesAfterEnv: ['../node_modules/aws-testing-library/lib/jest/index.js'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as dotenv from 'dotenv';
export default {
testEnvironment: 'node',
roots: ['../__tests__/'],
testMatch: ['**/*.(int|integration).mjs'],
testMatch: ['**/*.(int|integration).js'],
testTimeout: 60000 * 2, // 2 minutes timeout
}

Expand Down
2 changes: 1 addition & 1 deletion config/unit.jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
testEnvironment: 'node',
roots: ['../'],
testMatch: ['**/*.test.js', '**/*.test.mjs']
testMatch: ['**/*.test.js', '**/*.test.js']
}
Loading