Skip to content

Commit 6a8cccb

Browse files
authored
Merge pull request #40 from atsyplenkov/feat/tests
Feat/tests
2 parents 42e0666 + d7d4607 commit 6a8cccb

10 files changed

Lines changed: 684 additions & 21 deletions

File tree

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ updates:
88
- package-ecosystem: "npm" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
11-
interval: "weekly"
11+
interval: "monthly"

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main, develop ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
name: Test Extension
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Install xvfb and setup display
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y xvfb
31+
export DISPLAY=:99
32+
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
33+
sleep 5
34+
echo "Display setup complete"
35+
36+
- name: Verify display is working
37+
run: |
38+
export DISPLAY=:99
39+
xdpyinfo > /dev/null 2>&1 && echo "Display is working" || echo "Display not working"
40+
41+
- name: Run tests
42+
run: npm test
43+
env:
44+
DISPLAY: ':99'
45+
46+
- name: Check for linting errors
47+
run: npm run lint || echo "No lint script found, skipping lint check"
48+
49+
build:
50+
name: Build Extension
51+
runs-on: ubuntu-latest
52+
needs: test
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
58+
- name: Setup Node.js
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: '20'
62+
cache: 'npm'
63+
64+
- name: Install dependencies
65+
run: npm ci
66+
67+
- name: Build extension
68+
run: |
69+
npm install -g @vscode/vsce
70+
vsce package --out pastum-extension.vsix
71+
72+
- name: Upload extension artifact
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: pastum-extension
76+
path: pastum-extension.vsix
77+
retention-days: 30

.vscode-test.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,15 @@ import { defineConfig } from '@vscode/test-cli';
22

33
export default defineConfig({
44
files: 'test/**/*.test.js',
5+
launchArgs: [
6+
'--disable-gpu',
7+
'--disable-software-rasterizer',
8+
'--disable-dev-shm-usage',
9+
'--no-sandbox',
10+
'--disable-setuid-sandbox',
11+
'--disable-web-security',
12+
'--disable-features=VizDisplayCompositor'
13+
],
14+
extensionDevelopmentPath: '.',
15+
extensionTestsPath: './test'
516
});

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1-
<!-- badges: start -->
2-
[![Website](https://img.shields.io/website?url=https%3A%2F%2Fpastum.anatolii.nz)](https://pastum.anatolii.nz/) ![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/atsyplenkov.pastum?include_prereleases&style=flat&label=stable%20version&color=green&link=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Datsyplenkov.pastum) [![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/atsyplenkov.pastum?label=VS%20Marketplace%20installs&color=7abfbb&link=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Datsyplenkov.pastum)](https://marketplace.visualstudio.com/items?itemName=atsyplenkov.pastum) [![Open VSX Downloads](https://img.shields.io/open-vsx/dt/atsyplenkov/pastum?label=Open%20VSX%20downloads&color=c160ef)](https://open-vsx.org/extension/atsyplenkov/pastum) [![Deploy Extension](https://github.com/atsyplenkov/pastum/actions/workflows/publish-extensions.yml/badge.svg)](https://github.com/atsyplenkov/pastum/actions/workflows/publish-extensions.yml) ![GitHub License](https://img.shields.io/github/license/atsyplenkov/pastum?color=blue) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://img.shields.io/badge/Project%20Status-Active-brightgreen)](https://www.repostatus.org/#active)
3-
<!-- badges: end -->
4-
# [Pastum: paste as ... dataframe](https://pastum.anatolii.nz)
5-
6-
`pastum` allows you to quickly transform any text/HTML table from your clipboard into a dataframe object in your favorite language — R, Python, Julia or JavaScript. Almost all popular frameworks are supported; if something is missing, don't hesitate to raise an [issue](https://github.com/atsyplenkov/pastum/issues).
1+
# Pastum: paste as ... dataframe
2+
3+
<p align="center">
4+
<a href="https://pastum.anatolii.nz/">
5+
<img src="https://img.shields.io/website?url=https%3A%2F%2Fpastum.anatolii.nz&style=flat&labelColor=1e2c2e&color=007ACC&logo=Visual%20Studio%20Code&logoColor=white"></a>
6+
<a href="https://marketplace.visualstudio.com/items?itemName=atsyplenkov.pastum">
7+
<img src="https://img.shields.io/visual-studio-marketplace/i/atsyplenkov.pastum?style=flat&labelColor=1e2c2e&color=007ACC&logo=Visual%20Studio%20Code&logoColor=white&label=VS%20Marketplace%20installs"></a>
8+
<br>
9+
<a href="https://open-vsx.org/extension/atsyplenkov/pastum">
10+
<img src="https://img.shields.io/open-vsx/dt/atsyplenkov/pastum?style=flat&labelColor=1e2c2e&color=007ACC&logo=Open%20VSX&logoColor=white&label=Open%20VSX%20downloads"></a>
11+
<a href="https://github.com/atsyplenkov/pastum/actions/workflows/ci.yml">
12+
<img src="https://img.shields.io/github/actions/workflow/status/atsyplenkov/pastum/ci.yml?style=flat&labelColor=1e2c2e&color=007ACC&logo=GitHub%20Actions&logoColor=white&label=tests"></a>
13+
<a href="https://github.com/atsyplenkov/pastum/actions/workflows/publish-extensions.yml">
14+
<img src="https://img.shields.io/github/actions/workflow/status/atsyplenkov/pastum/publish-extensions.yml?style=flat&labelColor=1e2c2e&color=007ACC&logo=GitHub%20Actions&logoColor=white&label=deploy"></a>
15+
<br>
16+
<a href="https://github.com/atsyplenkov/pastum/blob/master/LICENSE.md">
17+
<img src="https://img.shields.io/github/license/atsyplenkov/pastum?style=flat&labelColor=1e2c2e&color=007ACC&logo=GitHub&logoColor=white"></a>
18+
</p>
19+
20+
`pastum` allows you to quickly transform any text/HTML table from your clipboard into a dataframe object in your favorite language — R, Python, Julia, JavaScript or Markdown. Almost all popular frameworks are supported; if something is missing, don't hesitate to raise an [issue](https://github.com/atsyplenkov/pastum/issues).
721

822
# Example usage
923

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Running Tests
2+
3+
The tests are designed to work with the VS Code Test Framework. To run them:
4+
5+
```bash
6+
npm test
7+
```
8+
9+
Or using the VS Code Test CLI:
10+
```bash
11+
npx @vscode/test-cli --extensionDevelopmentPath=. --extensionTestsPath=./test
12+
```
13+
14+
# Test Data Examples
15+
16+
The tests use various table formats to ensure comprehensive coverage:
17+
18+
## Simple Table
19+
```
20+
Name Age Score
21+
Alice 25 95.5
22+
Bob 30 87.2
23+
```
24+
25+
## Large Dataset Test
26+
```
27+
Generated tables with 1000+ rows and 50+ columns for performance testing
28+
```
29+
30+
## Special Characters in Headers
31+
```
32+
Column Name! @Price$ %Change
33+
Value1 100 5.5
34+
```
35+
36+
# Contributing
37+
38+
When adding new features:
39+
1. Add corresponding tests in the appropriate test file
40+
2. Focus on unit tests for core functionality
41+
3. Test edge cases and error conditions
42+
4. Verify module structure and exports
43+
5. Avoid complex async mocking

0 commit comments

Comments
 (0)