generated from archoleat/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Almanov Nikita <131481562+nikkeyl@users.noreply.github.com>
- Loading branch information
1 parent
951ab53
commit 14c6844
Showing
24 changed files
with
55 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
import { beforeEach, describe, expect, test as spec } from 'vitest'; | ||
|
||
import { createAtRule } from '#features/at-rule/at-rule.ts'; | ||
import { createAtRule } from '#features'; | ||
|
||
import type { Parameters } from '#at-rule-parameters'; | ||
|
||
describe('Create At Rule', () => { | ||
describe('Create At Rule', async () => { | ||
let atRule: Function; | ||
|
||
beforeEach(() => { | ||
const addAtRule = async (parameters: Parameters) => { | ||
beforeEach(async () => { | ||
atRule = async (parameters: Parameters) => { | ||
const { name, hasBlock } = parameters; | ||
|
||
return await createAtRule({ name, hasBlock }).then((parameters) => { | ||
expect(parameters.name).equal(name); | ||
expect(parameters.hasBlock).equal(hasBlock); | ||
expect(parameters.type).equal('at-rule'); | ||
}); | ||
}; | ||
const result = await createAtRule({ name, hasBlock }); | ||
|
||
atRule = addAtRule; | ||
expect(result.name).toBeTypeOf('string'); | ||
expect(result.hasBlock).toBeTypeOf('boolean'); | ||
expect(result.type).toEqual('at-rule'); | ||
|
||
return result; | ||
}; | ||
}); | ||
|
||
spec('create an object with (name: String, hasBlock: true)', async () => { | ||
return await atRule({ name: 'test-rule', hasBlock: true }); | ||
spec('should create an object with a block', async () => { | ||
await atRule({ name: 'test-rule-1', hasBlock: true }); | ||
}); | ||
|
||
spec('create an object with (name: String, hasBlock: false)', async () => { | ||
return await atRule({ name: 'test-rule', hasBlock: false }); | ||
spec('should create an object without a block', async () => { | ||
await atRule({ name: 'test-rule-2', hasBlock: false }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,26 @@ | ||
import { beforeEach, describe, expect, test as spec } from 'vitest'; | ||
|
||
import { createRule } from '#features/rule/rule.ts'; | ||
import { createRule } from '#features'; | ||
|
||
import type { Parameters } from '#rule-parameters'; | ||
|
||
describe('Create Rule', () => { | ||
describe('Create Rule', async () => { | ||
let rule: Function; | ||
|
||
beforeEach(() => { | ||
const addRule = async (parameters: Parameters) => { | ||
beforeEach(async () => { | ||
rule = async (parameters: Parameters) => { | ||
const { selector } = parameters; | ||
|
||
return await createRule({ selector }).then((parameters) => { | ||
expect(parameters.selector).equal(`&${selector}`); | ||
expect(parameters.type).equal('rule'); | ||
}); | ||
}; | ||
|
||
rule = addRule; | ||
}); | ||
|
||
spec('create an object with (::pseudo-element)', async () => { | ||
return await rule({ selector: '::pseudo-element' }); | ||
}); | ||
|
||
spec('create an object with (:pseudo-class)', async () => { | ||
return await rule({ selector: ':pseudo-class' }); | ||
}); | ||
|
||
spec('create an object with (?\\[(.*)\\])', async () => { | ||
return await rule({ selector: '?\\[(.*)\\]' }); | ||
}); | ||
const result = await createRule({ selector }); | ||
|
||
spec('create an object with (?\\.(.*))', async () => { | ||
return await rule({ selector: '?\\.(.*)' }); | ||
}); | ||
expect(result.selector).toEqual(`&${selector.replace(/^&+/g, '')}`); | ||
expect(result.type).toEqual('rule'); | ||
|
||
spec('create an object with (--)', async () => { | ||
return await rule({ selector: '--' }); | ||
return result; | ||
}; | ||
}); | ||
|
||
spec('create an object with (__)', async () => { | ||
return await rule({ selector: '__' }); | ||
spec('should create an object with selector', async () => { | ||
await rule({ selector: '&&&any-nested-css-selector' }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { CSSRules, SCSSRules } from './rules/index.ts'; | ||
export { propertiesOrder } from './properties/index.ts'; | ||
export { plugins } from './plugins.ts'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { propertiesOrder } from './order.ts'; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { CSSRules } from './css.ts'; | ||
export { SCSSRules } from './scss.ts'; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { createAtRule } from './at-rule/index.ts'; | ||
export { createLogicalGroup } from './logical-group/index.ts'; | ||
export { createRule } from './rule/index.ts'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { messages } from './messages.ts'; |