Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dandv committed Mar 29, 2019
0 parents commit 50a49bc
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/lib/backend-lib.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function backend() {
return 'backend';
}
33 changes: 33 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "backend",
"version": "1.0.0",
"scripts": {
"test": "jest"
},
"devDependencies": {
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"jest": "^24.5.0"
},
"jest": {
"testEnvironment": "node",
"testMatch": [
"**/?(*.)(spec|test).?(m)js?(x)"
],
"moduleFileExtensions": [
"js",
"mjs"
],
"transform": {
"^.+\\.m?js$": "babel-jest"
}
},
"babel": {
"env": {
"test": {
"plugins": [
"transform-es2015-modules-commonjs"
]
}
}
}
}
7 changes: 7 additions & 0 deletions backend/use-backend-lib.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Works fine

import { backend } from './lib/backend-lib';

test('test using backend library', () => {
expect(backend()).toBeTruthy();
});
7 changes: 7 additions & 0 deletions backend/use-project-lib.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Jest encountered an unexpected token

import { foo } from '../lib/project-lib';

test('test using project-level library', () => {
expect(foo()).toBeTruthy();
});
3 changes: 3 additions & 0 deletions lib/project-lib.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function foo() {
return 'foo';
}

0 comments on commit 50a49bc

Please sign in to comment.