diff --git a/.gitignore b/.gitignore
index 794fab1..9bfebba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,16 +27,17 @@ node_modules
# misc
/.sass-cache
/connect.lock
-/coverage
+**/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
+**/.scannerwork
# System Files
.DS_Store
Thumbs.db
# Next.js
-.next
\ No newline at end of file
+.next
diff --git a/analysis.sh b/analysis.sh
new file mode 100755
index 0000000..2f7ec46
--- /dev/null
+++ b/analysis.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+apt install wget
+wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip
+unzip sonar-scanner-cli-4.8.0.2856-linux.zip
+ls -la
+mv ./sonar-scanner-4.8.0.2856-linux ./sonarscanner
+cd apps
+../sonarscanner/bin/sonar-scanner -X -Dsonar.login=b6b66f8b798b46b693cc19f788215111871d5287
diff --git a/apps/sonar-project.properties b/apps/sonar-project.properties
new file mode 100644
index 0000000..d7c92d3
--- /dev/null
+++ b/apps/sonar-project.properties
@@ -0,0 +1,34 @@
+sonar.host.url=https://sonarqube.naser.fr/
+sonar.projectKey=david:guitar-apps
+sonar.projectName=Apps Guitar School
+sonar.projectVersion=0.1.0-SNAPSHOT
+
+# =====================================================
+# Meta-data for the project
+# =====================================================
+
+sonar.links.homepage=https://gitea.naser.fr/sebsn86/nx-guitar-school
+sonar.links.ci=https://teamcity.naser.fr/buildConfiguration/NxGuitarSchool_GuitarSchool?mode=builds#all-projects
+sonar.links.issues=https://gitea.naser.fr/sebsn86/nx-guitar-school/issues
+
+# =====================================================
+# Definition of the modules
+# =====================================================
+
+sonar.modules=website
+
+website.sonar.projectName=NextJS Guitar School
+
+# =====================================================
+# Properties that will be shared amongst all modules
+# =====================================================
+
+# Website properties
+website.sonar.projectBaseDir=./website
+website.sonar.sources=./
+website.sonar.exclusions=**/.next/**/.coverage/,**/.eslintrc.json,**/index.d.ts,**/jest.config.ts,**/next.config.js,**/postcss.config.js,**/tailwind.config.js,**/with-nx.js,**/*.css,**/*.scss,**/*.spec.ts,**/*.spec.tsx
+website.sonar.coverage.exclusions=**/.next/**/.coverage,**/.eslintrc.json,**/index.d.ts,**/jest.**/config.ts,**/next.config.js,**/postcss.config.js,**/tailwind.config.js,**/with-nx.js,**/*.css,**/*.scss
+website.sonar.language=ts
+website.sonar.tests=./tests
+website.sonar.javascript.lcov.reportPaths=./coverage/lcov.info
+website.sonar.sourceEncoding=UTF-8
diff --git a/apps/website/components/footer/footer.spec.tsx b/apps/website/components/footer/footer.spec.tsx
deleted file mode 100644
index 97c820b..0000000
--- a/apps/website/components/footer/footer.spec.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { render } from '@testing-library/react';
-
-import Footer from './footer';
-
-describe('Footer', () => {
- it('should render successfully', () => {
- const { baseElement } = render();
- expect(baseElement).toBeTruthy();
- });
-});
diff --git a/apps/website/components/seo-config/seo-config.spec.tsx b/apps/website/components/seo-config/seo-config.spec.tsx
deleted file mode 100644
index 8a25531..0000000
--- a/apps/website/components/seo-config/seo-config.spec.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { render } from '@testing-library/react';
-
-import SeoConfig from './seo-config';
-
-describe('SeoConfig', () => {
- it('should render successfully', () => {
- const { baseElement } = render();
- expect(baseElement).toBeTruthy();
- });
-});
diff --git a/apps/website/environments/environment.prod.ts b/apps/website/environments/environment.prod.ts
index 1e72c46..940d570 100644
--- a/apps/website/environments/environment.prod.ts
+++ b/apps/website/environments/environment.prod.ts
@@ -1,5 +1,5 @@
export const environment = {
- strapiUrl: 'http://admin.mecp.nasercloud.fr/',
- strapiApiUrl: 'http://admin.mecp.nasercloud.fr/api',
+ strapiUrl: 'https://admin.mecp.nasercloud.fr/',
+ strapiApiUrl: 'https://admin.mecp.nasercloud.fr/api',
nextAuthSecret: "yBNW1wrb9CgOvEfbX6EQCvCDqiMkRBZP"
}
diff --git a/apps/website/environments/environment.staging.ts b/apps/website/environments/environment.staging.ts
index 1e72c46..940d570 100644
--- a/apps/website/environments/environment.staging.ts
+++ b/apps/website/environments/environment.staging.ts
@@ -1,5 +1,5 @@
export const environment = {
- strapiUrl: 'http://admin.mecp.nasercloud.fr/',
- strapiApiUrl: 'http://admin.mecp.nasercloud.fr/api',
+ strapiUrl: 'https://admin.mecp.nasercloud.fr/',
+ strapiApiUrl: 'https://admin.mecp.nasercloud.fr/api',
nextAuthSecret: "yBNW1wrb9CgOvEfbX6EQCvCDqiMkRBZP"
}
diff --git a/apps/website/jest.config.ts b/apps/website/jest.config.ts
index 26339d7..5fc3e4d 100644
--- a/apps/website/jest.config.ts
+++ b/apps/website/jest.config.ts
@@ -4,10 +4,13 @@ export default {
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
- '^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
+ '^.+\\.[tj]sx?$': ['babel-jest', {presets: ['@nrwl/next/babel']}],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
collectCoverage: true,
- coverageReporters: ["clover", "json", "lcov", "text"],
- coverageDirectory: '../../coverage/apps/website',
+ coverageReporters: ["text", ["lcov", {"projectRoot": "./apps/website"}]],
+ coverageDirectory: './coverage',
+ moduleNameMapper: {
+ '^@/(.*)$': '/$1',
+ },
};
diff --git a/apps/website/sonar-project.properties b/apps/website/sonar-project.properties
deleted file mode 100644
index c706ee5..0000000
--- a/apps/website/sonar-project.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-sonar.projectKey=david:guitar-apps
-sonar.sources=./
-sonar.coverage.exclusions=.next/,.eslintrc.json,config.ts,index.d.ts,jest.config.ts,next.config.js,postcss.config.js,tailwind.config.js,with-nx.js
-sonar.language=ts
-sonar.tests=./
-sonar.javascript.lcov.reportPaths=../../coverage/apps/website/lcov.info
-sonar.testExecutionReportPaths=test-report.xml
-sonar.sourceEncoding=UTF-8
diff --git a/apps/website/components/carousel/carousel.spec.tsx b/apps/website/tests/carousel.spec.tsx
similarity index 79%
rename from apps/website/components/carousel/carousel.spec.tsx
rename to apps/website/tests/carousel.spec.tsx
index 4201b81..d766821 100644
--- a/apps/website/components/carousel/carousel.spec.tsx
+++ b/apps/website/tests/carousel.spec.tsx
@@ -1,6 +1,6 @@
import { render } from '@testing-library/react';
-import Carousel from './carousel';
+import Carousel from '../components/carousel/carousel';
describe('Carousel', () => {
it('should render successfully', () => {
diff --git a/apps/website/tests/footer.spec.tsx b/apps/website/tests/footer.spec.tsx
new file mode 100644
index 0000000..649ee31
--- /dev/null
+++ b/apps/website/tests/footer.spec.tsx
@@ -0,0 +1,10 @@
+import {render} from '@testing-library/react';
+
+import Footer from '../components/footer/footer';
+
+describe('Footer', () => {
+ it('should render successfully', () => {
+ const {baseElement} = render();
+ expect(baseElement).toBeTruthy();
+ });
+});
diff --git a/apps/website/components/header/header.spec.tsx b/apps/website/tests/header.spec.tsx
similarity index 83%
rename from apps/website/components/header/header.spec.tsx
rename to apps/website/tests/header.spec.tsx
index 6a63192..fd36c9e 100644
--- a/apps/website/components/header/header.spec.tsx
+++ b/apps/website/tests/header.spec.tsx
@@ -1,13 +1,12 @@
import {render} from '@testing-library/react';
-import {SessionProvider, useSession} from "next-auth/react";
-import Header from './header';
+import Header from '../components/header/header';
jest.mock("next-auth/react", () => {
const originalModule = jest.requireActual('next-auth/react');
const mockSession = {
expires: new Date(Date.now() + 2 * 86400).toISOString(),
- user: { username: "admin" }
+ user: {username: "admin"}
};
return {
__esModule: true,
diff --git a/apps/website/pages/index.spec.tsx b/apps/website/tests/index.spec.tsx
similarity index 100%
rename from apps/website/pages/index.spec.tsx
rename to apps/website/tests/index.spec.tsx
diff --git a/apps/website/components/layout/layout.spec.tsx b/apps/website/tests/layout.spec.tsx
similarity index 75%
rename from apps/website/components/layout/layout.spec.tsx
rename to apps/website/tests/layout.spec.tsx
index 5bb3c54..3bb4122 100644
--- a/apps/website/components/layout/layout.spec.tsx
+++ b/apps/website/tests/layout.spec.tsx
@@ -1,12 +1,12 @@
-import { render } from '@testing-library/react';
+import {render} from '@testing-library/react';
-import Layout from './layout';
+import Layout from '../components/layout/layout';
jest.mock("next-auth/react", () => {
const originalModule = jest.requireActual('next-auth/react');
const mockSession = {
expires: new Date(Date.now() + 2 * 86400).toISOString(),
- user: { username: "admin" }
+ user: {username: "admin"}
};
return {
__esModule: true,
@@ -19,7 +19,7 @@ jest.mock("next-auth/react", () => {
describe('Layout', () => {
it('should render successfully', () => {
- const { baseElement } = render();
+ const {baseElement} = render();
expect(baseElement).toBeTruthy();
});
});
diff --git a/apps/website/tests/seo-config.spec.tsx b/apps/website/tests/seo-config.spec.tsx
new file mode 100644
index 0000000..86431a1
--- /dev/null
+++ b/apps/website/tests/seo-config.spec.tsx
@@ -0,0 +1,10 @@
+import {render} from '@testing-library/react';
+
+import SeoConfig from '../components/seo-config/seo-config';
+
+describe('SeoConfig', () => {
+ it('should render successfully', () => {
+ const {baseElement} = render();
+ expect(baseElement).toBeTruthy();
+ });
+});