MCPcopy
hub / github.com/sonofmagic/weapp-tailwindcss / matchSnap

Function matchSnap

packages/weapp-tailwindcss/test/gulp.test.ts:34–65  ·  view source on GitHub ↗
(plugins: ReturnType<typeof createPlugins>)

Source from the content-addressed store, hash-verified

32}
33
34async function matchSnap(plugins: ReturnType<typeof createPlugins>) {
35 const { transformJs, transformWxml, transformWxss } = plugins
36 // const cssPath = path.resolve(gulpCasePath, '*.css')
37
38 const cssTask = gulp
39 .src('./src/**/*.css', {
40 cwd: gulpCasePath,
41 })
42 .pipe(transformWxss())
43
44 const result = await readContent(cssTask)
45 expect(normalizeSnapshotContent(result)).toMatchSnapshot('css')
46 await promisify(cssTask)
47
48 const jsTask = gulp
49 .src('./src/**/*.js', {
50 cwd: gulpCasePath,
51 })
52 .pipe(transformJs())
53
54 const wxmlTask = gulp
55 .src('./src/**/*.wxml', {
56 cwd: gulpCasePath,
57 })
58 .pipe(transformWxml())
59
60 const ptasks = [jsTask, wxmlTask]
61 const [jsRes, wxmlRes] = await Promise.all(ptasks.map(element => readContent(element)))
62 expect(normalizeSnapshotContent(jsRes)).toMatchSnapshot('js')
63 expect(normalizeSnapshotContent(wxmlRes)).toMatchSnapshot('wxml')
64 await Promise.all(ptasks.map(element => promisify(element)))
65}
66describe('gulp', () => {
67 it('common build', async () => {
68 await matchSnap(createPlugins({

Callers 1

gulp.test.tsFile · 0.85

Calls 7

readContentFunction · 0.85
normalizeSnapshotContentFunction · 0.85
mapMethod · 0.80
promisifyFunction · 0.70
transformWxssFunction · 0.50
transformJsFunction · 0.50
transformWxmlFunction · 0.50

Tested by

no test coverage detected