Skip to content

Commit 09aeb13

Browse files
authored
Update testing guide for copilot
1 parent 3a69ea4 commit 09aeb13

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

.github/copilot-instructions.md

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44

55
AlaSQL is an open source SQL database for JavaScript with a focus on query speed and data source flexibility for both relational data and schemaless data. It works in web browsers, Node.js, and mobile apps.
66

7-
## Project Structure
8-
9-
- `src/` - Source files numbered sequentially (e.g., `05copyright.js`, `10start.js`, etc.)
10-
- `dist/` - Built distribution files (generated, not committed)
11-
- `test/` - Test files following `test###.js` naming pattern where ### is typically the issue number or test###-B if the testfilenumber is already taken.
12-
- `types/` - TypeScript type definitions
13-
- `docs/` - Documentation
14-
- `examples/` - Example usage code
15-
16-
7+
## When Implementing Features
178

9+
1. **Understand the issue thoroughly** - Read related test cases and existing code
10+
2. **Write a test first** - Create `test/test###.js` for the issue where `###` is the id of the issue we are actually fixing.
11+
3. **Verify test fails** - Run `yarn test` to confirm the test catches the issue
12+
4. **Implement the fix** - Modify appropriate file(s) in `src/`
13+
5. **Format code** - Run `yarn format` before committing
14+
6. **Verify test passes** - Run `yarn test` again
1815

1916

20-
### Creating Tests
21-
2. Name new test files as `test/test###.js` where `###` is the GitHub issue number if applicable
17+
## How to to test files
18+
1. Make a test file
19+
- Name new test files as `test/test###.js` where `###` is the GitHub issue number of the issue we are actually fixing.
20+
- If the file already exists we name the file test/test###-B.js
2221
1. Copy the structure in `test/test000.js` as a template
2322
3. Tests should be self-contained and clear about what they're testing
2423
4. Use the Mocha test framework with standard assertions
@@ -48,17 +47,6 @@ yarn build
4847
- `src/alasqlparser.js` - Generated from Jison grammar (modify the `.jison` file instead)
4948
- `.min.js` files - Generated during build
5049

51-
### Node.js Version
52-
- Requires Node.js >= 20 for building
53-
54-
## When Implementing Features
55-
56-
1. **Understand the issue thoroughly** - Read related test cases and existing code
57-
2. **Write a test first** - Create `test/test###.js` for the issue
58-
3. **Verify test fails** - Run `yarn test` to confirm the test catches the issue
59-
4. **Implement the fix** - Modify appropriate file(s) in `src/`
60-
5. **Format code** - Run `yarn format` before committing
61-
6. **Verify test passes** - Run `yarn test` again
6250

6351
now commit the code.
6452

@@ -69,6 +57,4 @@ now commit the code.
6957
## Resources
7058

7159
- [AlaSQL Documentation](https://github.com/alasql/alasql/wiki)
72-
- [Contributing Guide](CONTRIBUTING.md)
73-
- [Stack Overflow Tag](http://stackoverflow.com/questions/ask?tags=AlaSQL)
7460
- [Issue Tracker](https://github.com/AlaSQL/alasql/issues)

0 commit comments

Comments
 (0)