diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..d444a8c --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,20 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true + }, + "extends": [ + "eslint:recommended" + ], + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": { + "no-console": "warn", + "no-unused-vars": "warn", + "semi": ["error", "always"], + "quotes": ["error", "single"] + } +} diff --git a/tests/example.test.js b/tests/example.test.js new file mode 100644 index 0000000..9939ad6 --- /dev/null +++ b/tests/example.test.js @@ -0,0 +1,19 @@ +// Example test file +// Install testing framework: npm install --save-dev jest + +describe('Example Test Suite', () => { + test('should add two numbers correctly', () => { + const result = 2 + 2; + expect(result).toBe(4); + }); + + test('should handle edge cases', () => { + expect(null).toBeNull(); + expect(undefined).toBeUndefined(); + }); +}); + +// Add this to package.json scripts: +// "test": "jest" +// "test:watch": "jest --watch" +// "test:coverage": "jest --coverage"