Skip to content
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
3 changes: 1 addition & 2 deletions .github/workflows/call_test_cases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ jobs:
if: ${{ steps.get_branch.outputs.branch == 'main' }}
uses: coverallsapp/github-action@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./app/coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ pnpm-debug.log*
*.sln
*.sw?

web/dist
frontend/dist


# ignore snapshots
__snapshots__/
Expand All @@ -30,4 +31,6 @@ __snapshots__/
coverage/

# ignore coverage_output.json
coverage_output.json
coverage_output.json
#SQLite DB
session_storage.db
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ COPY ./package.json .
COPY ./package-lock.json .
RUN npm install
COPY . .
RUN cd web && npm install && npm run build
RUN cd frontend && npm install && npm run build
CMD ["npm", "run", "start:prod"]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ npm install

Using yarn:
```
yarn install --cwd ./web
yarn install --cwd ./frontend
```
Using npm:
```
npm install --prefix ./web
npm install --prefix ./frontend
```


Expand All @@ -60,11 +60,11 @@ Build frontend.

Using yarn:
```
cd web && yarn run build
cd frontend && yarn run build
```
Using npm:
```
cd web && npm run build
cd frontend && npm run build
```


Expand Down
4 changes: 0 additions & 4 deletions __tests__/unit/global/test-teardown-globals.js

This file was deleted.

47 changes: 0 additions & 47 deletions app/.github/workflows/call_test_cases.yml

This file was deleted.

32 changes: 0 additions & 32 deletions coverage_output.js

This file was deleted.

File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions frontend/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
verbose: true,
coverageReporters: ["json-summary", "lcov", "cobertura"],
testMatch: ['**/test/**/*.spec.js'],
transform: {
"^.+\\.js$": "babel-jest",
"^.+\\.vue$": "@vue/vue3-jest",
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|gif|svg)$": "jest-transform-stub",
},
testEnvironment: "jsdom", // Simulate a browser environment for testing
testEnvironmentOptions: {
customExportConditions: ["node", "node-addons"],
},
moduleFileExtensions: ["js", "vue", "json"],
collectCoverage: true,
collectCoverageFrom: [
"./**/*.{js,vue}"
],
};

File renamed without changes.
36 changes: 18 additions & 18 deletions web/package-lock.json → frontend/package-lock.json

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

4 changes: 2 additions & 2 deletions web/package.json → frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "web",
"name": "frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vite",
"serve": "vite preview",
"build": "vite build",
"lint": "vue-cli-service lint",
"test": "jest --updateSnapshot --no-cache --detectOpenHandles --json --outputFile=./coverage/coverage.json"
"test": "jest"
},
"dependencies": {
"@gofynd/fdk-client-javascript": "^1.4.7",
Expand Down
4 changes: 2 additions & 2 deletions web/pages/Home.vue → frontend/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</div>
<div class="description">
This is an illustrative Platform API call to fetch the list of products
in this company. Go to your extension folder’s 'product.router.js'
directory to check how to call Platform API and start calling API you
in this company. Check your extension folder’s 'server.js'
file to know how to call Platform API and start calling API you
require.
</div>
</div>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import App from '../../App.vue';
import App from '../App.vue';

describe('App.vue', () => {
it('Renders App component successfully', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setCompany, getCompany, setApplication, getApplication } from '../../../helper/utils';
import { setCompany, getCompany, setApplication, getApplication } from '../../helper/utils';

describe('Utils Functions', () => {
it('Should set and get the company_id correctly', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

import { mount } from '@vue/test-utils'
import Home from '../../../pages/Home.vue'
import Home from '../../pages/Home.vue'
import { createRouter, createWebHistory } from 'vue-router'
import flushPromises from 'flush-promises'
import axios from 'axios'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { mount } from '@vue/test-utils';
import NotFound from '../../../pages/NotFound.vue';
import { shallowMount } from '@vue/test-utils';
import NotFound from '../../pages/NotFound.vue';

describe('NotFound.vue', () => {
it('Renders correctly with the expected content', () => {
const wrapper = mount(NotFound);
const wrapper = shallowMount(NotFound);
expect(wrapper.find('h1').text()).toBe('404');
expect(wrapper.find('p').text()).toBe('Oops! The page you are looking for does not exist. Please update relevent path.');
});
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

require("dotenv").config();
require('./sqlite.init');
const app = require("./server");
const port = process.env.BACKEND_PORT || 8080;

Expand Down
9 changes: 4 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ module.exports = {
verbose: true,
testEnvironment: 'node',
coverageReporters: ['json-summary', 'lcov'],
globalTeardown: './__tests__/unit/global/test-teardown-globals.js',
testPathIgnorePatterns: ['/web/'],
testPathIgnorePatterns: ['/frontend/'],
setupFiles: ['./jest.init.js'],
testMatch: [
'**/__tests__/**/*.spec.[jt]s?(x)',
'!**/__tests__/unit/global/**/*.[jt]s?(x)'
'**/test/**/*.spec.[jt]s?(x)',
'!**/test/global/**/*.[jt]s?(x)'
],
moduleFileExtensions: ['js', 'json'],
transform: {},
Expand All @@ -19,7 +18,7 @@ module.exports = {
collectCoverageFrom: [
'**/*.js', // Adjust this pattern to include the files you want to be covered
'!**/node_modules/**',
'!**/__tests__/**',
'!**/test/**',
'!**/jest.config.js',
'!**/index.js',
"!**/coverage/**",
Expand Down
2 changes: 1 addition & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"moduleResolution": "node",
"paths": {
"@/*": [
"web/*"
"frontend/*"
]
},
"lib": [
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"start": "npm run start:dev",
"start:dev": "nodemon index.js",
"start:prod": "NODE_ENV=production node index.js",
"test": "jest --config jest.config.js --no-cache --detectOpenHandles --json --outputFile=./coverage/coverage.json && node coverage_output.js"
"test": "jest --config jest.config.js --no-cache --detectOpenHandles --json --outputFile=./coverage/coverage.json"
},
"nodemonConfig": {
"ignore": [
"web/**"
"frontend/**"
]
},
"dependencies": {
Expand Down
Loading