Skip to content

Commit

Permalink
Merge branch 'main' into la/live-pixel-validator
Browse files Browse the repository at this point in the history
  • Loading branch information
ladamski authored Jan 24, 2025
2 parents a512789 + b01b27d commit 4f5f57f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ To validate:
```
$ cd ${RepoSpecificPixelFolder}
$ npm i
$ npx validate-defs .
$ npx validate-ddg-pixel-defs .
```

To validate a single file, you can use `npx validate-defs . -f ${path to file relative to pixels/ directory}`
To validate a single file, you can use `npx validate-ddg-pixel-defs . -f ${path to file relative to pixels/ directory}`

Validation will also run as part of CI.

Expand Down
2 changes: 2 additions & 0 deletions bin/validate_live_pixel.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env node

import fs from 'fs';
import JSON5 from 'json5';

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@duckduckgo/pixel-schema",
"version": "1.0.3",
"version": "1.0.5",
"files": [
"bin",
"schemas",
Expand Down
7 changes: 7 additions & 0 deletions tests/live_pixel_validation_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ describe('No common params nor suffixes', () => {
const expectedErrors = ["must NOT have additional properties. Found extra property 'param2'"];
expect(errors).to.have.members(expectedErrors);
});

it('ignores cache buster', () => {
const prefix = 'simplePixel';
const url = `/t/${prefix}?12345&param1=true`;
const errors = paramsValidator.validateLivePixels(pixelDefs[prefix], prefix, url);
expect(errors).to.be.empty;
});
});

describe('Common params', () => {
Expand Down

0 comments on commit 4f5f57f

Please sign in to comment.