|
| 1 | +import * as xmlNsLoader from "./xml-namespace-loader"; |
| 2 | +import { join } from "path"; |
| 3 | +import { deepStrictEqual } from "assert"; |
| 4 | + |
| 5 | +const code = ` |
| 6 | +<Page xmlns="http://www.nativescript.org/tns.xsd"> |
| 7 | + <GridLayout xmlns:chart="nativescript-ui-chart"> |
| 8 | + <chart:RadCartesianChart row="0"> |
| 9 | + <chart:RadCartesianChart.series> |
| 10 | + <chart:BarSeries items="{{ categoricalSource }}" |
| 11 | + categoryProperty="Country" valueProperty="Amount"> |
| 12 | + <chart:BarSeries.horizontalAxis> |
| 13 | + <chart:CategoricalAxis /> |
| 14 | + </chart:BarSeries.horizontalAxis> |
| 15 | + <chart:BarSeries.verticalAxis> |
| 16 | + <chart:LinearAxis /> |
| 17 | + </chart:BarSeries.verticalAxis> |
| 18 | + </chart:BarSeries> |
| 19 | + </chart:RadCartesianChart.series> |
| 20 | + </chart:RadCartesianChart> |
| 21 | + </GridLayout> |
| 22 | +</Page> |
| 23 | +` |
| 24 | + |
| 25 | +fdescribe("XmlNamespaceLoader", () => { |
| 26 | + |
| 27 | + it("with ignored files", (done) => { |
| 28 | + const deps: string[] = []; |
| 29 | + const loaderContext = { |
| 30 | + rootContext: "app", |
| 31 | + context: "some-file.xml", |
| 32 | + async: () => (error, source: string) => { |
| 33 | + console.log("callback called: ", source); |
| 34 | + done(); |
| 35 | + }, |
| 36 | + resolve: (context: string, request: string, callback: (err: Error, result: string) => void) => { |
| 37 | + callback(undefined, join(context, request)); |
| 38 | + }, |
| 39 | + addDependency: (dep: string) => { |
| 40 | + deps.push(dep); |
| 41 | + }, |
| 42 | + query: {} |
| 43 | + } |
| 44 | + |
| 45 | + xmlNsLoader.call(loaderContext, code); |
| 46 | + }) |
| 47 | +}); |
0 commit comments