Audit qualité : corrections de bugs, nettoyage, lint 0 erreur, tests #4

Merged
cedric merged 20 commits from fix/audit-2026-07-04 into master 2026-07-04 17:01:35 +00:00
2 changed files with 23 additions and 1 deletions
Showing only changes of commit 7b9968cb82 - Show all commits
+22
View File
@@ -0,0 +1,22 @@
import {describe, it, expect, afterEach} from 'vitest'
import robots from '../robots'
describe('robots', () => {
const originalNodeEnv = process.env.NODE_ENV
afterEach(() => {
process.env.NODE_ENV = originalNodeEnv
})
it('autorise l\'indexation en production', () => {
process.env.NODE_ENV = 'production'
expect(robots().rules).toEqual({userAgent: '*', allow: '/'})
})
it('bloque l\'indexation hors production', () => {
process.env.NODE_ENV = 'development'
expect(robots().rules).toEqual({userAgent: '*', disallow: '/'})
})
})
+1 -1
View File
@@ -1,5 +1,5 @@
export default function robots() { export default function robots() {
const isProduction = process.env.NEXT_PUBLIC_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
if (!isProduction) { if (!isProduction) {
return { return {